Sunday, November 7, 2010

Re: help with django comments

here's my complete code:

{%if allowcomments%}
{% get_comment_count for
galleryview.GalleryPhoto picid as comment_count %}
<p>
{%ifequal comment_count 0%}
Be the first to comment.
{%else%}
<b>{{comment_count}}
comment{%ifnotequal comment_count 1%}s{%endifnotequal%}</b><br/>
{%endifequal%}

{% render_comment_list for
galleryview.GalleryPhoto %}
{% render_comment_form for
galleryview.GalleryPhoto%}

{%else%}
{%endif%}


allowcomments is a field in my model. am i missing something here? I
thought it was easy to attach comments to any model.


On Nov 7, 9:41 am, Chris Lawlor <lawlor.ch...@gmail.com> wrote:
> Assuming your app is named 'gallery' with a model named 'photo', I
> believe the call should be:
>
> {% get_comment_count for gallery.photo as comment_count %}
>
> On Nov 6, 5:12 pm, Bobby Roberts <tchend...@gmail.com> wrote:
>
> > howdy -
>
> > i'm trying to use comments on my site as follows:
>
> > {% get_comment_count for galleryphoto as comment_count %}
>
> > this generates the following error:
>
> > Caught AttributeError while rendering: 'str' object has no attribute
> > '_meta'
>
> > any idea what this error means?
>
> > I looked in /admin and under comments and in objects, i see "gallery
> > photo" (with a space).
>
> > when i try to use:
>
> > {% get_comment_count for gallery photo as comment_count %}   <<< note
> > the space in gallery photo
>
> > I get this err:
>
> > Third argument in u'get_comment_count' must be in the format
> > 'app.model'
>
> > any help is appreciated on how to address this issue.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate