Add summary_fields capability, which for items in a collection gives the names of related fields.

{
   'summary_fields' : {
       'organization' : {
          'name' : 'foo',
          'description' : 'bar',
       }
   }

}

etc.  This is automatic for all field types configured in serializers.py (SUMMARIZABLE_FKs, etc).
This commit is contained in:
Michael DeHaan
2013-05-08 17:36:04 -04:00
parent 51ef375183
commit 6238f0ab9a
3 changed files with 34 additions and 6 deletions

View File

@@ -874,5 +874,6 @@ def create_auth_token_for_user(sender, **kwargs):
try:
Token.objects.get_or_create(user=instance)
except DatabaseError:
pass # Only fails when creating a new superuser from syncdb on a
# new database (before migrate has been called).
pass
# Only fails when creating a new superuser from syncdb on a
# new database (before migrate has been called).