Created
December 4, 2019 08:08
-
-
Save gen1us2k/1b11f6a3116fd8e8bea11280250c8ed4 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
| from django import forms | |
| class ForecastForm(forms.Form): | |
| city = forms.CharField() | |
| def clean_city(self): | |
| if 'city' not in self.cleaned_data: | |
| raise forms.ValidationError("Invalid city", "invalid") | |
| return self.cleaned_data['city'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment