Hi,
On Jul 13, 1:42 am, Tomáš Ehrlich <
tomas.ehrl...@gmail.com> wrote:
> Hi there,
> why there is no reference to commented object in preview?
>
Any specific use-case? Specifying it can make it easier to decide.
> django/contrib/comments/views/comments.py:95
> return render_to_response(
> template_list, {
> "comment" : form.data.get("comment", ""),
> "form" : form,
> "next": next,
> },
> RequestContext(request, {})
> )
>
The line of thinking was that preview would perform form-level
validation and the model-level validation (that of checking for
duplicates etc) would be done on save.
> It would be nice to have "object" variable with commented object.
> Views knows about it using content type and pk. Thanks to lazy
> evaluations of querysets, there won't be any hits to database unless
> necessary.
There would be one query, that for checking duplicate comments if the
object is sent through the context.
I think this is a valid request to open a ticket and marked as DDN so
that the core team may decide.
--
Cheers
Theju