Is there a specific reason you aren't just using CreateView rather than
trying to mix in a bunch of classes and trying to roll the post() logic
yourself? You can probably cut a very large portion of code out and make
this super simple.

https://docs.djangoproject.com/en/1.6/topics/class-based-views/generic-editing/#model-forms

You should also consider upgrading Django immediately to a newer version,
as 1.6 is no longer supported.

-James
The override is this, I was experimenting with save..


> class CommentForm(forms.ModelForm):
>     class Meta:
>         model = Comment
>         exclude = ("parent_post","created_at")
>
>
>     def create_view(request, **kwargs):
>         print "IN VIEW"
>         if request.method == "POST":
>             parent_fk = self.object
>             print "PARRENT"
>             print parent_fk
>             form = CommentForm(request.POST)
>             if form.is_valid():
>                 new_comment = form.save(commit=False)
>                 new_comment.parent_post = parent_fk
>                 new_comment.save()
>                 return HttpResponseRedirect(request.META.get(
> 'HTTP_REFERER'))
>
>
>  --
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/6825b838-584c-4e89-bc4e-4a6d0bf81c5f%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/6825b838-584c-4e89-bc4e-4a6d0bf81c5f%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciUFy7tGdtL9jzRd6xXZadWQGKroW%2BKUs%3D71X7h9tZpxtg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to