Created
September 15, 2017 10:31
-
-
Save fandrefh/96b49612efe17ed694335c2e430c5086 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
#forms.py | |
class MyForm(forms.Form): | |
field1 = forms.CharField(label='Field 1') | |
#views.py | |
def my_view(request): | |
if request.method == 'POST': | |
form = MyForm(request.POST) | |
if form.is_valid(): | |
field1 = form.cleaned_data['field'] | |
# Do something... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment