add support for pk property in documents and filters

This commit is contained in:
Timothée Peignier
2010-10-03 18:50:35 +02:00
parent 556eed0151
commit 9c9903664a
5 changed files with 78 additions and 7 deletions

View File

@@ -312,6 +312,9 @@ class QuerySet(object):
for field_name in parts:
if field is None:
# Look up first field from the document
if field_name == 'pk':
# Deal with "primary key" alias
field_name = document._meta['id_field']
field = document._fields[field_name]
else:
# Look up subfield on the previous field