Opened 5 years ago

Closed 5 years ago

#12167 closed (wontfix)

related objects should not trigger db query on reverese related lookup

Reported by: Suor Owned by: nobody
Component: Uncategorized Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I'm having smth like:

    class Place(models.Model):
        pass

    class Flank(models.Model):
        place = models.ForeignKey(Place, related_name='flanks')

loading place from db:

    p = Place.objects.get(pk=...)
    flanks = p.flanks.all()
    flanks[0].place  # Should not trigger db query !

Also, it flanks[0].place should be the same as p.
I realize this issue relates to #17, but nobody knows when that will be solved. And fixing this seems easy.

Change History (1)

comment:1 Changed 5 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

Fixing this is *really* not easy. Closing as wontfix, this isn't even a dupe of #17, this is just a ridiculously difficult to implement special case.

Note: See TracTickets for help on using tickets.
Back to Top