Thursday, 15 March 2012

Django Dynamic Forms -


I am using to create a dynamic form. I have everything work, but save the data in the database. Has anyone got any code that does this or can show me that what is the best way to do this model should be established?

save () override method on your form class:

def save (self): new_user = User.objects.create_user (user name = self.cleaned_data ['username'], email = self.cleaned_data ['email'], password = self.cleaned_data [ 'Password1']) returns new_user

(taken from James Bennett's blog)


No comments:

Post a Comment