Skip to content

Instantly share code, notes, and snippets.

@kennethlove
Created January 24, 2014 23:11
Show Gist options
  • Save kennethlove/8608720 to your computer and use it in GitHub Desktop.
Save kennethlove/8608720 to your computer and use it in GitHub Desktop.
class FooMixin(object):
def get_formset(self, request, obj=None, **kwargs):
form = self.form
form.fields['butts'].queryset = Butts.objects.filter(oily=True)
kwargs.update({'form': form})
return super(FooMixin, self).get_formset(request, obj=obj, kwargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment