mirror of
https://github.com/django/django.git
synced 2025-10-30 17:16:10 +00:00
magic-removal: Added Manager.__get__ method that forbids access by instances. Also added unit tests. Thanks, rjwittams
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1615 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -180,6 +180,18 @@ False
|
||||
>>> Article.objects.get_pub_date_list('day', order='DESC')
|
||||
[datetime.datetime(2005, 7, 31, 0, 0), datetime.datetime(2005, 7, 30, 0, 0), datetime.datetime(2005, 7, 29, 0, 0), datetime.datetime(2005, 7, 28, 0, 0)]
|
||||
|
||||
# An Article instance doesn't have access to the "objects" attribute.
|
||||
# That is only available as a class method.
|
||||
>>> a7.objects.get_list()
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
AttributeError: Manager isn't accessible via Article instances
|
||||
|
||||
>>> a7.objects
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
AttributeError: Manager isn't accessible via Article instances
|
||||
|
||||
"""
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
Reference in New Issue
Block a user