Re: 'str' object has no attribute '_meta' while using comment system
Ok. I get it. form should have an object instance. Thanks for pointing it out. And sorry to bother you from my stupid mistake. On Nov 27, 10:14 am, "Chatchai Neanudorn" <[EMAIL PROTECTED]> wrote: > 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 > > > > 271 {% load comments %} > > > > 272 {% get_comment_count for form as comment_count %} > > > > 273 This Report has {{ comment_count }} comments > > > > 274 > > > > 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 -~--~~~~--~~--~--~---
Re: 'str' object has no attribute '_meta' while using comment system
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 > > > 271 {% load comments %} > > > 272 {% get_comment_count for form as comment_count %} > > > 273 This Report has {{ comment_count }} comments > > > 274 > > > 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 -~--~~~~--~~--~--~---
Re: 'str' object has no attribute '_meta' while using comment system
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 > > 271 {% load comments %} > > 272 {% get_comment_count for form as comment_count %} > > 273 This Report has {{ comment_count }} comments > > 274 > > 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 -~--~~~~--~~--~--~---
Re: 'str' object has no attribute '_meta' while using comment system
{% 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 > 271 {% load comments %} > 272 {% get_comment_count for form as comment_count %} > 273 This Report has {{ comment_count }} comments > 274 > 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 -~--~~~~--~~--~--~---
'str' object has no attribute '_meta' while using comment system
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 271 {% load comments %} 272 {% get_comment_count for form as comment_count %} 273 This Report has {{ comment_count }} comments 274 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 -~--~~~~--~~--~--~---