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

File 2145-one-to-one-field_editable.diff, 610 bytes (added by tyson, 7 years ago)

Patch to allow editing of OneToOneFields

  • db/models/fields/related.py

     
    704704    """
    705705    def __init__(self, to, to_field=None, **kwargs):
    706706        kwargs['unique'] = True
    707         kwargs['editable'] = False
     707        if kwargs.get('parent_link', False):
     708            kwargs.setdefault('editable', False)
    708709        if 'num_in_admin' not in kwargs:
    709710            kwargs['num_in_admin'] = 0
    710711        super(OneToOneField, self).__init__(to, to_field, OneToOneRel, **kwargs)
Back to Top