Is it possible to disable django related_name for a specific field?

Example:

class Route(models.Model): last_waypoint_visited = models.ForeignKey('WayPoint') class WayPoint(models.Model): route = models.ForeignKey(Route) 

Since WayPoint already has a link to Route via the route field, I really don't need the last_waypoint_visited field to create a link back to Route.

Is it possible to disable the creation of a backlink for the field "last_waypoint_visited"?

+5
source share
1 answer

Yes, this is a documentary function :

 last_waypoint_visited = models.ForeignKey('WayPoint', related_name='+') 
+10
source

Source: https://habr.com/ru/post/1210740/


All Articles