rosemanblog
  • About me
  • Technical

Django patterns, part 2: efficient reverse lookups

Date Mon 11 January 2010 Category Technical Tags django / patterns / foreignkey / query-efficiency

One of the main sources of unnecessary database queries in Django applications is reverse relations.

By default, Django doesn't do anything to follow relations across models. This means that unless you're careful, any relationship can lead to extra hits on the database. For instance, assuming MyModel has a ...

View commentss.

more ...

  • Social

    • twitter
    • github
    • stackoverflow
    • rss
  • Tags

    • django
    • patterns
    • python
    • vim
    • query-efficiency
    • mingus
    • generic-relation
    • terminal
    • aggregation
    • ORM

© 2010 Daniel Roseman · Powered by pelican-bootstrap3, Pelican, Bootstrap

Back to top