Created
April 6, 2010 23:06
-
-
Save vbmendes/358245 to your computer and use it in GitHub Desktop.
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
class MyForm(forms.ModelForm): | |
... | |
def __init__(self, *args, **kwargs): | |
self.competition = kwargs.pop('competition') | |
super(MyForm, self).__init__(*args, **kwargs) | |
def clean(self): | |
""" Use self.competition here """ |
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
... | |
competition = get_object_or_404(Competition, slug=competition_slug) | |
form = MyForm(request.POST, competition=competition) | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment