what happen if form = "" ?

better to use meaning full object, you will need to use form in advance

2008/11/27 izzy <[EMAIL PROTECTED]>

>
> Yes I've done that.
>
> def packagingreport_details(request, object_id):
>        report = get_object_or_404(PackagingReport, pk=object_id)
>        user = request.user
>        messages = ''
>        errors = ''
>        if report.author == user:
>                form = report
>        else:
>                form = ''
>                errors = 'You are not allowed to view this report.'
>        return render_to_response('shiftmanager/
> packagingreport_details.html', {'form': form, 'messages': messages,
> 'errors': errors})
>
>
> The context form is a PackagingReport Object
>
> On Nov 27, 9:51 am, "Chatchai Neanudorn" <[EMAIL PROTECTED]> wrote:
> > {% get_comment_count for *form *as comment_count %}
> >
> > make sure you put the right object (in your code is form, what is it? do
> you
> > have template context names form?) for comment templatetag and it is
> > available
> >
> > chatchai
> >
> > 2008/11/27 izzy <[EMAIL PROTECTED]>
> >
> >
> >
> > > Hi all.
> >
> > > I've been having a problem regarding my app using comment system in
> > > Django1.0.2.
> >
> > > I've used comment so that anyone can comment on the report. When I
> > > view the report with the comment using the user that writes a comment
> > > it will raise no error but when I tried to login as different user I
> > > can't it raises an error:
> >
> > > Template error
> >
> > > In template d:\smp\templates\shiftmanager
> > > \productionreport_details.html, error at line 272
> >
> > > Caught an exception while rendering: 'str' object has no attribute
> > > '_meta'
> >
> > > 270     <div class="comments">
> > > 271     {% load comments %}
> > > 272     {% get_comment_count for form as comment_count %}
> > > 273     <h3>This Report has {{ comment_count }} comments</h3>
> > > 274     <table id="comments">
> > > 275     {% get_comment_list for form as comment_list %}
> > > 276     {% for comment in comment_list %}
> >
> > > please help
> >
>

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to