Ticket #7947: 7947-one-to-one-field_editable.diff

File 7947-one-to-one-field_editable.diff, 610 bytes (added by rokclimb15, 16 years ago)

Modified patch to cleanly apply to trunk code

  • db/models/fields/related.py

     
    747747    """
    748748    def __init__(self, to, to_field=None, **kwargs):
    749749        kwargs['unique'] = True
    750         kwargs['editable'] = False
     750        if kwargs.get('parent_link', False):
     751            kwargs.setdefault('editable', False)
    751752        if 'num_in_admin' not in kwargs:
    752753            kwargs['num_in_admin'] = 0
    753754        super(OneToOneField, self).__init__(to, to_field, OneToOneRel, **kwargs)
Back to Top