Changes between Initial Version and Version 2 of Ticket #25887


Ignore:
Timestamp:
Dec 8, 2015, 1:46:07 AM (9 years ago)
Author:
Miriam Gershenson
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #25887

    • Property Cc benjaminjkraft@… added
  • Ticket #25887 – Description

    initial v2  
    77class CustomForeignKey(models.ForeignKey):
    88    def formfield(self, **kwargs):
    9         defaults = {'form_class': IntegerField} # or a subclass of IntegerField
     9        defaults = {'form_class': forms.IntegerField} # or a subclass of forms.IntegerField
    1010        defaults.update(kwargs)
    1111        return super(CustomForeignKey, self).formfield(**defaults)
     
    2222# This will work fine until I try to submit the form
    2323class NormalFKModelForm(forms.ModelForm):
    24     fk = IntegerField()
     24    fk = forms.IntegerField()
    2525    class Meta:
    2626        model = NormalFKModel
Back to Top