I hereby claim:
- I am dashdrum on github.
- I am dashdrum (https://keybase.io/dashdrum) on keybase.
- I have a public key ASDgh02asru5cZ6Rn9TwTka_IfA1PyHT-nfXhvVI8u7Fzgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
from __future__ import unicode_literals | |
from django.forms import ChoiceField | |
''' Based on https://gist.github.com/davidbgk/651080 | |
modified to mirror the functionality of ModelChoiceField ''' | |
class EmptyChoiceField(ChoiceField): | |
def __init__(self, choices=(), empty_label="---------", required=True, widget=None, label=None, | |
initial=None, help_text=None, *args, **kwargs): | |
class FormsetMixin(object): | |
""" Use for a form + 1 formset """ | |
detail_form_class = None | |
def get_detail_form_class(self): | |
""" | |
Returns the detail form class to use in this view | |
""" | |
return self.detail_form_class |
from django.forms import ChoiceField | |
''' Based on https://gist.github.com/davidbgk/651080 | |
modified to mirror the functionality of ModelChoiceField ''' | |
class EmptyChoiceField(ChoiceField): | |
def __init__(self, choices=(), empty_label=u"---------", required=True, widget=None, label=None, | |
initial=None, help_text=None, *args, **kwargs): | |
# prepend an empty label unless the field is required AND |