Code

Ticket #1281: 1281_patch.diff

File 1281_patch.diff, 773 bytes (added by python@…, 8 years ago)

patch (same as diff in description)

Line 
1Index: c:/python24/lib/site-packages/django-0.91-py2.4.egg/django/core/meta/__init__.py
2===================================================================
3--- c:/python24/lib/site-packages/django-0.91-py2.4.egg/django/core/meta/__init__.py    (revision 1616)
4+++ c:/python24/lib/site-packages/django-0.91-py2.4.egg/django/core/meta/__init__.py    (working copy)
5@@ -460,6 +460,10 @@
6         for f in to_search:
7             if f.name == name:
8                 return f
9+        if (hasattr(self, 'one_to_one_field') and
10+            self.one_to_one_field is not None and
11+            self.one_to_one_field.name == name):
12+            return self.one_to_one_field
13         raise FieldDoesNotExist, "name=%s" % name
14
15     def get_order_sql(self, table_prefix=''):