Ticket #211: edit-inline.diff

File edit-inline.diff, 1.1 KB (added by Manuzhai, 10 years ago)

edit_inline is implicitly True when edit_inline_type is provided

  • fields.py

     
    531540            kwargs['name'] = kwargs.get('name', to_name + '_id')
    532541            kwargs['verbose_name'] = kwargs.get('verbose_name', to._meta.verbose_name)
    533542            rel_name = rel_name or to_name
     543        if 'edit_inline_type' in kwargs:
     544                kwargs['edit_inline'] = True
    534545        kwargs['rel'] = ManyToOne(to, rel_name, to_field,
    535546            num_in_admin=kwargs.pop('num_in_admin', 3),
    536547            min_num_in_admin=kwargs.pop('min_num_in_admin', None),
     
    573584        kwargs['verbose_name'] = kwargs.get('verbose_name', 'ID')
    574585        to_field = to_field or to._meta.pk.name
    575586        rel_name = rel_name or to._meta.object_name.lower()
     587        if 'edit_inline_type' in kwargs:
     588                kwargs['edit_inline'] = True
    576589        kwargs['rel'] = OneToOne(to, rel_name, to_field,
    577590            num_in_admin=kwargs.pop('num_in_admin', 0),
    578591            edit_inline=kwargs.pop('edit_inline', False),
Back to Top