Ticket #9498: generic.py_helpers.py_r9329.diff

File generic.py_helpers.py_r9329.diff, 892 bytes (added by markus _uploading_ evigo _patch_ net, 16 years ago)
  • contrib/admin/helpers.py

     
    150150        return AdminField(self.form, self.formset._pk_field.name, False)
    151151   
    152152    def fk_field(self):
    153         return AdminField(self.form, self.formset.fk.name, False)
     153        try:
     154            return AdminField(self.form, self.formset.fk.name, False)
     155        except KeyError, e:
     156            return ""
    154157
    155158    def deletion_field(self):
    156159        from django.forms.formsets import DELETION_FIELD_NAME
  • contrib/contenttypes/generic.py

     
    355355                                   fields=fields, exclude=exclude, max_num=max_num)
    356356    FormSet.ct_field = ct_field
    357357    FormSet.ct_fk_field = fk_field
     358    FormSet.fk = fk_field
    358359    return FormSet
    359360
    360361class GenericInlineModelAdmin(InlineModelAdmin):
Back to Top