Ticket #11477: 11477.diff

File 11477.diff, 948 bytes (added by Chris Beaven, 15 years ago)
  • docs/topics/generic-views.txt

    ### Eclipse Workspace Patch 1.0
    #P Django trunk
     
    268268However, there's actually a subtle bug here -- can you spot it?
    269269
    270270The problem has to do with when the queries in ``extra_context`` are evaluated.
    271 Because this example puts ``Publisher.objects.all()`` in the URLconf, it will
     271Because this example puts ``Book.objects.all()`` in the URLconf, it will
    272272be evaluated only once (when the URLconf is first loaded). Once you add or
    273 remove publishers, you'll notice that the generic view doesn't reflect those
     273remove books, you'll notice that the generic view doesn't reflect those
    274274changes until you reload the Web server (see :ref:`caching-and-querysets`
    275275for more information about when QuerySets are cached and evaluated).
    276276
Back to Top