On Sep 23, 11:07 am, Eric Abrahamsen <[EMAIL PROTECTED]> wrote:
> Somewhat pursuant to this
> thread:http://groups.google.com/group/django-users/browse_thread/thread/a0c4...
>
> a hidden 'next' field in the comment post form doesn't get carried
> over to the comment preview view. It seems like if you're going to
> have a manual 'next' value possible in the comment post, you'd also
> want that value accessible in the preview view. Currently the only
> context variables getting passed to comment_preview.html are the
> comment text, and the form data (which ignores the 'next' field), and
> as far as I know that's not enough to reconstruct the redirect URL I'm
> after (comment.content_object.get_absolute_url). If that's right, I'll
> submit a patch that passes thenextvalue to comment_preview.html.
To answer my own question, a much more robust way of handling this is
to subclass the built-in CommentForm and add fields to it, that way
the custom values are all retained in the 'form' variable that gets
passed to the preview view. Like so:
from django.contrib import comments
from myproject.stuff import MyCommentForm
def my_get_form():
return MyCommentForm
comments.get_form = my_get_form
Custom values can be picked out of the request in signal handlers.
Hope someone else finds that useful...
E
>
> Thanks,
> Eric
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---