Hello,
I have a form that I have created and it works fine. I am now trying
to save this form. The data returned from the form spans a
relationship and should update 2 tables associated by a foreign key.
>From what I have read on the docs, because it is an unbound form I
need to write my own save method. This is what I have been trying:
from django import forms
from project.pastebin.models import loggenerator
from project.pastebin.models import entry
from project.pastebin.models import submittedlog
class pasteForm(forms.Form):
loggenerator = forms.ModelChoiceField(loggenerator.objects.all())
log = forms.CharField(widget=forms.Textarea)
def save(self):
newlog = project.objects.entry(sessionhash=sessionhash,
uniqueurl=uniqueurl)
return newlog
And it's not working. The above is code I am trying that to avoid
complication at this stage with the relationship I was hoping would
just update one table, but the code doesn't work. I can't find
anything really detailed about saving forms that are unbound to
models. If anyone can link me something that might put me on track I'd
be grateful.
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---