Ticket #13834: natural_key_assertion.diff
File natural_key_assertion.diff, 677 bytes (added by , 14 years ago) |
---|
-
django/core/serializers/python.py
49 49 if related is not None: 50 50 if self.use_natural_keys and hasattr(related, 'natural_key'): 51 51 related = related.natural_key() 52 assert isinstance(related, tuple), \ 53 'natural_key methods should always return a tuple' 52 54 else: 53 55 if field.rel.field_name == related._meta.pk.name: 54 56 # Related to remote object via primary key