Ticket #1281: 1281_patch2.diff
File 1281_patch2.diff, 1.6 KB (added by , 19 years ago) |
---|
-
c:/python24/lib/site-packages/django-0.91-py2.4.egg/django/core/meta/__init__.py
460 460 for f in to_search: 461 461 if f.name == name: 462 462 return f 463 if (hasattr(self, 'one_to_one_field') and 464 self.one_to_one_field is not None and 465 self.one_to_one_field.name == name): 466 return self.one_to_one_field 463 467 raise FieldDoesNotExist, "name=%s" % name 464 468 465 469 def get_order_sql(self, table_prefix=''): … … 1843 1847 # case, because they'll be dealt with later. 1844 1848 1845 1849 if f == related.field: 1846 param = getattr(new_object, related.field.rel.field_name) 1850 to = related.field.rel.to 1851 if (hasattr(to, 'one_to_one_field') and 1852 to.one_to_one_field and 1853 to.one_to_one_field.name == related.field.rel.field_name): 1854 param = getattr(new_object, related.field.rel.field_name + '_id') 1855 else: 1856 param = getattr(new_object, related.field.rel.field_name) 1847 1857 elif add and isinstance(f, AutoField): 1848 1858 param = None 1849 1859 elif change and (isinstance(f, FileField) or not child_follow.get(f.name, None)):