Ticket #8748: primkey_inline.diff
File primkey_inline.diff, 1013 bytes (added by , 16 years ago) |
---|
-
models.py
119 119 opts = instance._meta 120 120 data = {} 121 121 for f in opts.fields + opts.many_to_many: 122 if not f.editable :122 if not f.editable and not f.primary_key: 123 123 continue 124 124 if fields and not f.name in fields: 125 125 continue … … 153 153 field_list = [] 154 154 opts = model._meta 155 155 for f in opts.fields + opts.many_to_many: 156 if not f.editable :156 if not f.editable and not f.primary_key: 157 157 continue 158 158 if fields and not f.name in fields: 159 159 continue 160 160 if exclude and f.name in exclude: 161 161 continue 162 162 formfield = formfield_callback(f) 163 164 if not f.editable: 165 formfield.widget.id_for_label=None 166 formfield.widget.input_type='hidden' 167 163 168 if formfield: 164 169 field_list.append((f.name, formfield)) 165 170 return SortedDict(field_list)