Skip to content

Instantly share code, notes, and snippets.

@jleeothon
Last active August 29, 2024 00:06
Show Gist options
  • Save jleeothon/fd736e7b18e692e63440 to your computer and use it in GitHub Desktop.
Save jleeothon/fd736e7b18e692e63440 to your computer and use it in GitHub Desktop.
Change label suffix for Django forms
# have all your forms extend this mixin
class NoLabelSuffixMixin:
def __init__(self, *args, **kwargs):
if 'label_suffix' not in kwargs:
kwargs['label_suffix'] = ''
super(NoLabelSuffixMixin, self).__init__(*args, **kwargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment