django-comments

AttributeError: 'str' object has no attribute '_meta'

自古美人都是妖i 提交于 2019-12-10 22:37:12
问题 I just begin to study Django, and today come to the comment part, I just practice from the Django Document.https://docs.djangoproject.com/en/1.4/ref/contrib/comments/example/. The command to add comment form works well when i do my practice on DetailView page but now I also want to add a comment form to ListView page then it got this error. below is the traceback: Environment: Request Method: GET Django Version: 1.4.3 Python Version: 2.7.3 Installed Applications: ('django.contrib.auth',

Django's comments framework and CSRF

醉酒当歌 提交于 2019-12-10 10:47:48
问题 I understand that the Django's comments framework was designed for anonymous public comments like you commonly see below a blog or an artcile. In other words, anyone can post comments. I am using the comments framework for only allowing logged in users to display comments. What I did was modify the form.html and hid the name , URL , and email field (leaving the security fields intact). So pretty much the user only sees a comment field. I wanted to use Django's comments since it already has

Django notification on comment submission

雨燕双飞 提交于 2019-12-04 12:40:19
I am making use of Django's contrib.comments and want to know the following. Are there any utils or app out there that can be plugged into an app that sends you a notification when a comment is posted on an item? I haven't really worked with signals that much, so please be a little bit descriptive. This is what I came up with. from django.contrib.comments.signals import comment_was_posted from django.core.mail import send_mail if "notification" in settings.INSTALLED_APPS: from notification import models as notification def comment_notification(request): user = request.user message = "123"

django comment framework: distinct() does not work?

不打扰是莪最后的温柔 提交于 2019-12-04 06:11:48
Running distinct() on any field of the comment model always returns all the records, Comment.objects.values('user').distinct() [{'user': 1}, {'user': 0}, {'user': 0}, {'user': 0}, {'user': 0}, {'user': 1}, {'user': 1}, {'user': 1}, {'user': 1}] Comment.objects.values('ip_address').distinct() [{'ip_address': u'127.0.0.1'},{'ip_address': u'192.168.0.180'}, {'ip_address':u'192.168.0.180'}, {'ip_address': u'192.168.0.180'}, {'ip_address': u'192.168.0. 180'}, {'ip_address': u'192.168.0.180'}, {'ip_address': u'192.168.0.180'}, {'ip_address': u'192.168.0.180'}, {'ip_address': u'192.168.0.180'}] Why

A user with no email can't post a comment using Django's comments framework

岁酱吖の 提交于 2019-12-01 08:09:16
I have overrode the comments framework's form.html template with my own {% load comments i18n %} <form action="{% comment_form_target %}" method="post">{% csrf_token %} <div><input type="hidden" name="next" value="{{ request.get_full_path }}" /></div> {% for field in form %} {% if field.is_hidden %} <div>{{ field }}</div> {% else %} {% if field.name != "name" and field.name != "url" and field.name != "email" %} {% if field.errors %}{{ field.errors }}{% endif %} <p {% if field.errors %} class="error"{% endif %} {% ifequal field.name "honeypot" %} style="display:none;"{% endifequal %} > {{ field

Django Comments: Want to remove user URL, not expand the model. How to?

喜欢而已 提交于 2019-11-30 08:40:04
I'm totally understanding the documentation on expanding the Comments app in Django, and really would like to stick with the automatic functionality but ... In the current app, I have absolutely no use for an "URL" to be submitted along with a comment. Being minimally invasive of the default setup, how can I prevent this field from showing up with the comment form ? Using Django 1, or Trunk, and as many generic/built-ins as possible (generic views, default comments set up, etc. I have only a single generic view wrapper so far). SmileyChris This is well documented under customizing the comments

How to extend the comments framework (django) by removing unnecessary fields?

空扰寡人 提交于 2019-11-30 00:30:17
I've been reading on the django docs about the comments framework and how to customize it ( http://docs.djangoproject.com/en/1.1/ref/contrib/comments/custom/ ) In that page, it shows how to add new fields to a form. But what I want to do is to remove unnecesary fields, like URL, email (amongst other minor mods.) On that same doc page it says the way to go is to extend my custom comments class from BaseCommentAbstractModel , but that's pretty much it, I've come so far and now I'm at a loss. I couldn't find anything on this specific aspect. I recently implemented the solution that Ofri mentioned

heroku, postgreSQL, django, comments, tastypie: No operator matches the given name and argument type(s). You might need to add explicit type casts

喜你入骨 提交于 2019-11-28 09:42:50
I have a simple query on django's built in comments model and getting the error below with heroku's postgreSQL database: DatabaseError: operator does not exist: integer = text LINE 1: ... INNER JOIN "django_comments" ON ("pi ns_pin"."id" = "django_... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. After googling around it seems this error has been addressed many times before in django, but I'm still getting it (all related issues were closed 3-5 years ago) . I am using django version 1.4 and the latest build of tastypie. The query is

heroku, postgreSQL, django, comments, tastypie: No operator matches the given name and argument type(s). You might need to add explicit type casts

核能气质少年 提交于 2019-11-27 03:09:10
问题 I have a simple query on django's built in comments model and getting the error below with heroku's postgreSQL database: DatabaseError: operator does not exist: integer = text LINE 1: ... INNER JOIN "django_comments" ON ("pi ns_pin"."id" = "django_... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. After googling around it seems this error has been addressed many times before in django, but I'm still getting it (all related issues