mirror of
https://github.com/django/django.git
synced 2025-07-20 01:29:11 +00:00
A handful of fixes to django.contrib.comments:
* Fixed #9143, #9429, and #9439 (was r9730 on trunk) * Fixed #9959: comment preview documentation example (was r9731 on trunk) * Fixed #9346: comment upgrade SQL in documentation. (was r9732 on trunk). git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9738 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
7dd0abc113
commit
0cc51e8fdd
@ -1,5 +1,4 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.conf import settings
|
|
||||||
from django.contrib.comments.models import Comment
|
from django.contrib.comments.models import Comment
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
import re
|
|
||||||
import time
|
import time
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.forms.util import ErrorDict
|
from django.forms.util import ErrorDict
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.http import Http404
|
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
from models import Comment
|
from models import Comment
|
||||||
from django.utils.encoding import force_unicode
|
from django.utils.encoding import force_unicode
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
from django.dispatch import dispatcher
|
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
from django.utils.encoding import force_unicode
|
from django.utils.encoding import force_unicode
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ class Comment(BaseCommentAbstractModel):
|
|||||||
Return this comment as plain text. Useful for emails.
|
Return this comment as plain text. Useful for emails.
|
||||||
"""
|
"""
|
||||||
d = {
|
d = {
|
||||||
'user': self.user,
|
'user': self.user or self.name,
|
||||||
'date': self.submit_date,
|
'date': self.submit_date,
|
||||||
'comment': self.comment,
|
'comment': self.comment,
|
||||||
'domain': self.site.domain,
|
'domain': self.site.domain,
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<form action="." method="post">
|
<form action="." method="post">
|
||||||
<input type="hidden" name="next" value="{{ next }}" id="next" />
|
<input type="hidden" name="next" value="{{ next }}" id="next" />
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
<input type="submit" name="submit" value="{% trans "Approve" %}" /> or <a href="{{ comment.permalink }}">cancel</a>
|
<input type="submit" name="submit" value="{% trans "Approve" %}" /> or <a href="{{ comment.get_absolute_url }}">cancel</a>
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<form action="." method="post">
|
<form action="." method="post">
|
||||||
<input type="hidden" name="next" value="{{ next }}" id="next" />
|
<input type="hidden" name="next" value="{{ next }}" id="next" />
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
<input type="submit" name="submit" value="{% trans "Remove" %}" /> or <a href="{{ comment.permalink }}">cancel</a>
|
<input type="submit" name="submit" value="{% trans "Remove" %}" /> or <a href="{{ comment.get_absolute_url }}">cancel</a>
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<form action="." method="post">
|
<form action="." method="post">
|
||||||
<input type="hidden" name="next" value="{{ next }}" id="next" />
|
<input type="hidden" name="next" value="{{ next }}" id="next" />
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
<input type="submit" name="submit" value="{% trans "Flag" %}" /> or <a href="{{ comment.permalink }}">cancel</a>
|
<input type="submit" name="submit" value="{% trans "Flag" %}" /> or <a href="{{ comment.get_absolute_url }}">cancel</a>
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
from django.conf.urls.defaults import *
|
from django.conf.urls.defaults import *
|
||||||
from django.conf import settings
|
|
||||||
|
|
||||||
urlpatterns = patterns('django.contrib.comments.views',
|
urlpatterns = patterns('django.contrib.comments.views',
|
||||||
url(r'^post/$', 'comments.post_comment', name='comments-post-comment'),
|
url(r'^post/$', 'comments.post_comment', name='comments-post-comment'),
|
||||||
|
@ -9,7 +9,6 @@ from django.core import urlresolvers
|
|||||||
from django.shortcuts import render_to_response
|
from django.shortcuts import render_to_response
|
||||||
from django.template import RequestContext
|
from django.template import RequestContext
|
||||||
from django.core.exceptions import ObjectDoesNotExist
|
from django.core.exceptions import ObjectDoesNotExist
|
||||||
from django.conf import settings
|
|
||||||
from django.contrib import comments
|
from django.contrib import comments
|
||||||
|
|
||||||
def next_redirect(data, default, default_view, **get_kwargs):
|
def next_redirect(data, default, default_view, **get_kwargs):
|
||||||
|
@ -156,7 +156,7 @@ A complete form might look like::
|
|||||||
<form action="{% comment_form_target %}" method="POST">
|
<form action="{% comment_form_target %}" method="POST">
|
||||||
{{ form }}
|
{{ form }}
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
<input type="submit" name="submit" class="submit-post" value="Preview">
|
<input type="submit" name="preview" class="submit-post" value="Preview">
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ run the following SQL:
|
|||||||
comment, submit_date, ip_address, is_public, is_removed)
|
comment, submit_date, ip_address, is_public, is_removed)
|
||||||
SELECT
|
SELECT
|
||||||
content_type_id, object_id, site_id, person_name, '', '', comment,
|
content_type_id, object_id, site_id, person_name, '', '', comment,
|
||||||
submit_date, ip_address, is_public, approved
|
submit_date, ip_address, is_public, not approved
|
||||||
FROM comments_freecomment;
|
FROM comments_freecomment;
|
||||||
|
|
||||||
INSERT INTO django_comments
|
INSERT INTO django_comments
|
||||||
|
Loading…
x
Reference in New Issue
Block a user