#17750: User.get_profile() returns cached object when database object has 
changed
------------------------------+--------------------
     Reporter:  rjalves       |      Owner:  nobody
         Type:  New feature   |     Status:  new
    Component:  contrib.auth  |    Version:  SVN
     Severity:  Normal        |   Keywords:
 Triage Stage:  Unreviewed    |  Has patch:  1
Easy pickings:  0             |      UI/UX:  0
------------------------------+--------------------
 Currently there is no way to bypass the cache if we know that the cached
 object is going to be outdated.

 For instance when using tests one may want to retrieve the user profile
 data in order to prepopulate a form and after posting the form data one
 may want to check if the alteration was successful. In this case the last
 call to get_profile() will return the object as it was before the post.

 I therefore suggest that the attribute cached=True is added to
 .get_profile() such that by default the cache is used but if needed one
 can request .get_profile(False) or .get_profile(cached=False) to hit the
 database again.

 Attached patch with code changes and updated unittests.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17750>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to