mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #3703 -- Added pk property to models. Thanks, Collin Grady and jeromie@gmail.com.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6346 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
1de4bf0b66
commit
e2409750f8
4 changed files with 30 additions and 0 deletions
|
@ -33,6 +33,11 @@ __test__ = {'API_TESTS': """
|
|||
>>> a.id
|
||||
1L
|
||||
|
||||
# Models have a pk property that is an alias for the primary key attribute (by
|
||||
# default, the 'id' attribute).
|
||||
>>> a.pk
|
||||
1L
|
||||
|
||||
# Access database columns via Python attributes.
|
||||
>>> a.headline
|
||||
'Area man programs in Python'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue