Skip to content

Instantly share code, notes, and snippets.

@esseti

esseti/widget.py Secret

Created March 30, 2018 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esseti/8157cfc2a19c3c3ff5032c72ce8f981d to your computer and use it in GitHub Desktop.
Save esseti/8157cfc2a19c3c3ff5032c72ce8f981d to your computer and use it in GitHub Desktop.
class MyWidget(forms.widgets.CheckboxSelectMultiple):
template_name = 'web_admin/partial/checkbox.html'
option_template_name = 'web_admin/partial/panel_item_p.html'
def get_context(self, name, value, attrs):
ctx = super().get_context(name, value, attrs)
# update the context adding the qs
ctx.update(dict(qs=self.qs))
return ctx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment