Last active
August 29, 2024 00:06
-
-
Save jleeothon/fd736e7b18e692e63440 to your computer and use it in GitHub Desktop.
Change label suffix for Django forms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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