Trips Year ModelForm Factory¶
-
fyt.db.forms.make_tripsyear_formfield_callback(trips_year)[source]¶ Return a function responsible for making formfields.
Used to restrict field choices to matching trips_year.
-
fyt.db.forms.tripsyear_modelform_factory(model, trips_year, *args, **kwargs)[source]¶ Model form factory which restricts related object choices to those for trips_year.
formfield_callbackis responsible for constructing aFormFieldfrom a passedModelField. Our callback intercepts the usual ForeignKey implementation and restricts the queryset to objects of thistrips_year