Skip to content

Instantly share code, notes, and snippets.

@martinsam
Last active December 17, 2015 16:00
Show Gist options
  • Save martinsam/5636033 to your computer and use it in GitHub Desktop.
Save martinsam/5636033 to your computer and use it in GitHub Desktop.
django: Formset parameters
from django.utils.functional import curry
from django.forms.models import modelformset_factory
ManagerFormset = modelformset_factory(User, ManagerForm, extra=0)
ManagerFormset.form = staticmethod(curry(ManagerForm, selected=selected, company=company))
form = ManagerFormset(queryset=coworkers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment