Example:
class Route(models.Model):
last_waypoint_visited = models.ForeignKey('WayPoint')
class WayPoint(models.Model):
route = models.ForeignKey(Route)
Since WayPoint already has a reference to Route through the route field, I don't really need the field last_waypoint_visited to generate a back reference to Route.
Is it possible do just disable the back reference creation for the "last_waypoint_visited" field?
Yes, disabling backward relations is a documented feature:
last_waypoint_visited = models.ForeignKey('WayPoint', related_name='+')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With