Created
June 2, 2018 18:33
-
-
Save maxpoletaev/c075f28aae402cce966604083cce51fb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class StaticInitialFormSet(forms.BaseInlineFormSet): | |
_initial = None | |
@classmethod | |
def set_initial(cls, initial): | |
cls._initial = initial | |
def __init__(self, *args, **kwargs): | |
super().__init__(*args, **kwargs) | |
if self._initial is not None: | |
self.initial = self._initial |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment