Skip to content

Instantly share code, notes, and snippets.

@ustun
Created May 3, 2014 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ustun/8789956a9cb84cdda73b to your computer and use it in GitHub Desktop.
Save ustun/8789956a9cb84cdda73b to your computer and use it in GitHub Desktop.
In [1]: u = User(username="foo")
In [2]: u.save()
In [3]: from myapp.models import *
In [4]: my_form = StudentProfileForm({"name": "Foo", "website": "http://foo.com"})
In [5]: my_form.is
my_form.is_bound my_form.is_multipart my_form.is_valid
In [5]: my_form.is_valid()
Out[5]: True
In [6]: my_instance = my_form.save(commit=False)
In [7]: my_instance.student = u
In [8]: my_instance.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment