Changeset 6346 for django/trunk/tests/modeltests/custom_pk
- Timestamp:
- 09/15/07 20:57:25 (1 year ago)
- Files:
-
- django/trunk/tests/modeltests/custom_pk/models.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/tests/modeltests/custom_pk/models.py
r6200 r6346 57 57 [<Employee: Fran Bones>, <Employee: Dan Jones>] 58 58 59 # The primary key can be accessed via the pk property on the model. 60 >>> e = Employee.objects.get(pk='ABC123') 61 >>> e.pk 62 u'ABC123' 63 64 # Or we can use the real attribute name for the primary key: 65 >>> e.employee_code 66 u'ABC123' 67 59 68 # Fran got married and changed her last name. 60 69 >>> fran = Employee.objects.get(pk='XYZ456')
