mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Modified the implementation of get_object() to be consistent with the approach used elsewhere in the API. Also added documentation for get_object() which seems to have been accidentally omitted.
This is a BACKWARDS-INCOMPATIBLE CHANGE for anyone depending on the API for get_object() that was introduced (but not documented) in r14254. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14292 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
46c17654ed
commit
a014ee0288
5 changed files with 28 additions and 13 deletions
|
@ -440,9 +440,9 @@ object, so we simply override it and wrap the call::
|
|||
|
||||
queryset = Author.objects.all()
|
||||
|
||||
def get_object(self, **kwargs):
|
||||
def get_object(self):
|
||||
# Call the superclass
|
||||
object = super(AuthorDetailView, self).get_object(**kwargs)
|
||||
object = super(AuthorDetailView, self).get_object()
|
||||
# Record the lass accessed date
|
||||
object.last_accessed = datetime.datetime.now()
|
||||
object.save()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue