Jarek Zgoda wrote:
> Is there any document with new comment framework customization tips?
> I'd like to switch finally to 1.0 but I don't know how to accomplish
> few things (or have ugly workarounds):
>
> * do not display preview page after succesful posting of comment, go
> to commented document instead (currently I have redirecting view and
> handle it in my urlconf before urlconf of django.contrib.comments is
> imported);
Use a hidden form field with special `next` name, its value will be used
to specify where to redirect after `/comments/post` view.
<input type="hidden" name="next" value="{{ entry.get_absolute_url }}" />
You can't do this for delete view, though (it's broken).
> * do not display preview page on errors, redisplay the form instead
> (no workaround yet);
No way to do it right now if you want to show both form with errors and
object being commented on the same view.
> * do not require email at all (I set it to empty string in my custom
> comment form using hidden field).
You'll need to subclass CommentForm with `required=False` in email
field. You'll want to use this new form in your templates, see
`get_form` function in contrib.comments' `__init__.py`. Looks like there
is no way to do this other than hacking up your own app which will
provide a new `get_form` definition.
I'd stick to a workaround with hidden form field.
--
Happy Hacking.
http://sphinx.net.ru
む
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---