Code

Ticket #211: edit-inline.diff

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

edit_inline is implicitly True when edit_inline_type is provided

Line 
1Index: fields.py
2===================================================================
3--- fields.py   (revision 426)
4+++ fields.py   (working copy)
5@@ -531,6 +540,8 @@
6             kwargs['name'] = kwargs.get('name', to_name + '_id')
7             kwargs['verbose_name'] = kwargs.get('verbose_name', to._meta.verbose_name)
8             rel_name = rel_name or to_name
9+        if 'edit_inline_type' in kwargs:
10+               kwargs['edit_inline'] = True
11         kwargs['rel'] = ManyToOne(to, rel_name, to_field,
12             num_in_admin=kwargs.pop('num_in_admin', 3),
13             min_num_in_admin=kwargs.pop('min_num_in_admin', None),
14@@ -573,6 +584,8 @@
15         kwargs['verbose_name'] = kwargs.get('verbose_name', 'ID')
16         to_field = to_field or to._meta.pk.name
17         rel_name = rel_name or to._meta.object_name.lower()
18+        if 'edit_inline_type' in kwargs:
19+               kwargs['edit_inline'] = True
20         kwargs['rel'] = OneToOne(to, rel_name, to_field,
21             num_in_admin=kwargs.pop('num_in_admin', 0),
22             edit_inline=kwargs.pop('edit_inline', False),