I hereby claim:
- I am jmorakuebler on github.
- I am jmorakuebler (https://keybase.io/jmorakuebler) on keybase.
- I have a public key ASCBo0PFRnm0mAH3O0uk24P80DGpAEYlyys9ErK4HHrhtAo
To claim this, I am signing this object:
from django.forms import ModelForm | |
from crispy_forms.helper import FormHelper | |
from crispy_forms.bootstrap import FormActions | |
from crispy_forms.layout import Layout, HTML, Div, Submit | |
# Put it variable to avoid writing it twice | |
buttons_layout = Layout( | |
Div( | |
HTML('<br>'), | |
FormActions( |
class CustomBaseInlineFormSet(BaseInlineFormSet): | |
""" | |
Custom BaseInlineFormSet with overridden clean method to look for | |
duplicates in the inline formset. | |
A message will appear under the offending field. | |
The field to be evaluated must be provided. | |
Attributes | |
field_name(string): name of the field to be verified. Default is None | |
msg (string): the message that will appear under the field. Default |
from django.template import Library | |
register = Library() | |
@register.simple_tag | |
def get_field_verbose_name(instance, field_name): | |
"""Returns the verbose_name of the specified field.""" | |
return instance._meta.get_field(field_name).verbose_name.title() |
I hereby claim:
To claim this, I am signing this object: