Commit Graph

113 Commits

Author SHA1 Message Date
Luke Plant 48edb177ed Fixed #12053 - form examples don't validate according to w3c
Thanks to skyl for the report.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@12086 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-04 21:55:52 +00:00
Jannis Leidel b9d698e9f2 Fixed #10285 - Added render_comment_list template tag to comments app. Thanks Kyle Fuller for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12082 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-04 02:29:12 +00:00
Jannis Leidel abcf997713 Fixed #11100 - Added get_comment_permalink template tag to comments app to be able to customize the anchor pattern of a comment from the template. Thanks to Idan Gazit for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12080 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-04 02:28:09 +00:00
Russell Keith-Magee ff60c5f9de Fixed #1142 -- Added multiple database support.
This monster of a patch is the result of Alex Gaynor's 2009 Google Summer of Code project.
Congratulations to Alex for a job well done.

Big thanks also go to:
 * Justin Bronn for keeping GIS in line with the changes,
 * Karen Tracey and Jani Tiainen for their help testing Oracle support
 * Brett Hoerner, Jon Loyens, and Craig Kimmerer for their feedback.
 * Malcolm Treddinick for his guidance during the GSoC submission process.
 * Simon Willison for driving the original design process
 * Cal Henderson for complaining about ponies he wanted.

... and everyone else too numerous to mention that helped to bring this feature into fruition.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11952 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-22 15:18:51 +00:00
Luke Plant 7230a995ce Moved contrib.csrf.* to core code.
There is stub code for backwards compatiblity with Django 1.1 imports.

The documentation has been updated, but has been left in
docs/contrib/csrf.txt for now, in order to avoid dead links to
documentation on the website.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@11661 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-10-27 00:36:34 +00:00
Luke Plant 8e70cef9b6 Fixed #9977 - CsrfMiddleware gets template tag added, session dependency removed, and turned on by default.
This is a large change to CSRF protection for Django.  It includes:

 * removing the dependency on the session framework.
 * deprecating CsrfResponseMiddleware, and replacing with a core template tag.
 * turning on CSRF protection by default by adding CsrfViewMiddleware to
   the default value of MIDDLEWARE_CLASSES.
 * protecting all contrib apps (whatever is in settings.py)
   using a decorator.

For existing users of the CSRF functionality, it should be a seamless update,
but please note that it includes DEPRECATION of features in Django 1.1,
and there are upgrade steps which are detailed in the docs.

Many thanks to 'Glenn' and 'bthomas', who did a lot of the thinking and work
on the patch, and to lots of other people including Simon Willison and
Russell Keith-Magee who refined the ideas.

Details of the rationale for these changes is found here:

http://code.djangoproject.com/wiki/CsrfProtection

As of this commit, the CSRF code is mainly in 'contrib'.  The code will be
moved to core in a separate commit, to make the changeset as readable as
possible.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@11660 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-10-26 23:23:07 +00:00
Jacob Kaplan-Moss 8be1bb2268 Fixed #11625: added comment moderation via admin actions.
This is BACKWARDS INCOMPATIBLE if you were using the completely undocumented moderation view from 1.1. That view's been removed in favor of the admin actions.

Thanks, Thejaswi Puthraya.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11639 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-10-23 19:22:31 +00:00
Russell Keith-Magee 8aee95ca3e Fixed #11995 -- Modified the admin site definition for comments so that users are shown as a raw id list. Thanks to James Bennett for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11601 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-10-08 13:30:31 +00:00
Russell Keith-Magee f908eded21 Fixed #9268 -- Ensured that the next argument is passed on when previewing comments. Thanks to leanmeandonothingmachine for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11019 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-17 13:01:40 +00:00
Jacob Kaplan-Moss d246401552 Fixed #11113: fixed a couple of issues that slipped through the cracks when comment moderation was added to `django.contrib.comments`.
The is a potentially backwards-incompatible change for users already relying on the internals of comment moderaration. To wit:

   * The moderation system now listens to the new `comment_will_be_posted`/`comment_was_posted` signals instead of `pre/post_save`. This means that import request-based information is available to moderation as it should be.
   * Some experimental code from `django.contrib.comments.moderation` has been removed. It was never intended to be merged into Django, and was completely untested and likely buggy.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10784 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-14 15:20:50 +00:00
Jacob Kaplan-Moss 752cc49a62 Fixed #10169: don't accidentally try to redirect to "None" after posting a comment.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10429 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-07 20:22:36 +00:00
Jacob Kaplan-Moss f2bdc14a95 Fixed #10633, #10691: marked strings in the comments app for translation. Thanks, zgoda.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10427 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-07 19:57:01 +00:00
Jacob Kaplan-Moss 6319470f88 Fixed #10585: comment redirects built from the `next` parameter now work correctly when `next` already contains a query string.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10424 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-07 19:49:07 +00:00
Jacob Kaplan-Moss eef2c5f6de Fixed #9956: relax the URL pattern for primary keys in the comment redirect so that models with custom PKs aren't cut out of the loop.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10422 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-07 19:40:59 +00:00
Jacob Kaplan-Moss 92a38be9c6 Fixed #9792: corrected invalid HTML in the comment form and comment preview.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10420 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-07 19:34:21 +00:00
Jacob Kaplan-Moss f8adf99cdb Fixed #9268: pass the "next" param through in the comment preview/post view. Also updated the docs to make this a bit clearer.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10418 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-07 19:28:13 +00:00
Jacob Kaplan-Moss f0560dfdb2 Fixed #9282: added a generic comment moderation toolkit. See the documentation for details.
This began life as (part of) James Bennett's comment-utils app, and was adapted to be part of Django by Thejaswi Puthraya and Jannis Leidel. Thanks, all!

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10122 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-23 21:07:02 +00:00
Jacob Kaplan-Moss 231a7e0419 Fixed #9958: split the `CommentForm` into a set of smaller forms. This for better encapsulation, but also so that it's easier for subclasses to get at the pieces they might need. Thanks to Thejaswi Puthraya.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10110 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-21 13:45:31 +00:00
Jacob Kaplan-Moss e923b545a4 Fixed #9303 (again) by removing some code missing in [9891].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10109 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-21 13:45:15 +00:00
Jacob Kaplan-Moss c485e236bd Fixed #8193: all dynamic imports in Django are now done correctly. I know this because Brett Cannon borrowed the time machine and brought Python 2.7's '`importlib` back for inclusion in Django. Thanks for the patch-from-the-future, Brett!
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10088 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-18 16:55:59 +00:00
Jacob Kaplan-Moss 1aac357d34 Fixed #9303: comment templatetags no longer assume the built-in comment model.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9891 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-23 22:46:32 +00:00
Jacob Kaplan-Moss 63d85a684a Fixed #8630: finished the custom comment app API that was left out of 1.0. This means it's now possible to override any of the models, forms, or views used by the comment app; see the new custom comment app docs for details and an example. Thanks to Thejaswi Puthraya for the original patch, and to carljm for docs and tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9890 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-23 22:16:26 +00:00
Jacob Kaplan-Moss 7d4a954836 Refactored CommentForm.get_comment_object into a handful of separete methods to make it easier for subclasses to provide custom models and data. Refs #8630.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9889 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-23 22:16:00 +00:00
Jacob Kaplan-Moss 4035ea3538 A few small fixes to django.contrib.comments (Comment.get_as_text for non-authenticated users; references to Comment.permalink; unused imports). Fixes #9143, #9429, and 9439. Thanks, Thejaswi Puthraya.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9730 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-12 17:27:41 +00:00
Malcolm Tredinnick cff78c60ac Fixed #8963 -- Use the require_POST decorator instead of doing things manually in one of the comment views. Thanks, zgoda.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9121 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-05 05:10:35 +00:00
Malcolm Tredinnick 645029accb Fixed #9100 -- Added a missing CSS class to a submit button.
Thanks, mordyovits and thejaswi_puthraya.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9120 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-05 05:09:59 +00:00
Malcolm Tredinnick 8524089769 Add internationalisation support to the comment templates. Fixed #8868, #8905
Thanks to zgoda for a patch that did most of the internationalisation part.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9119 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-05 05:09:21 +00:00
Malcolm Tredinnick 227a93b64f Fixed #8803 -- Allow authenticated users without first_name/last_name values set to post comments.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9118 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-05 05:07:32 +00:00
Malcolm Tredinnick 16d0a615c4 Fixed #8869 -- Fixed comments templates to be well-formed XHTML.
Based on a patch from zgoda.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9117 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-05 05:06:26 +00:00
Malcolm Tredinnick 18f13aeeab Fixed #8879 -- Used ungettext instead of ngettext in the comments framework.
Patch from zgoda.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9116 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-05 05:05:32 +00:00
Malcolm Tredinnick cf34d1f687 Fixed #9141 -- Removed two templates from django.contrib.comments that were not being used.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9115 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-05 05:04:56 +00:00
James Bennett 788e6c081b Use correct m2m join table name in LatestCommentsFeed
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9089 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-28 02:55:56 +00:00
James Bennett cc72e64e19 Fixed #9203: Restore correct ordering for LatestCommentsFeed
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9088 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-28 02:50:09 +00:00
Adrian Holovaty 8ec8e1a5e8 Fixed #8870 -- Changed django.contrib.comments templates to use lowercase 'post' for <form method> attributes, to be consistent with our other templates. Thanks, zgoda
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9050 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-16 06:15:26 +00:00
Wilson Miner b79cb53d76 Fixed #8917 -- Comments are now displayed in reverse order by submit_date in the admin. Thanks to arien for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9038 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-16 00:25:21 +00:00
Adrian Holovaty 5cc93500e8 Fixed #8959 -- Removed redundant calls to the 'escape' template filter in the django.contrib.comments templates. Thanks, zgoda
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9000 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-10 05:14:59 +00:00
Malcolm Tredinnick 96a417f91d Fixed two XHTML errors pointed out by Jarek Zgoda. Refs #8855.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8958 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-03 22:46:39 +00:00
Malcolm Tredinnick e1f1bda3c7 Fixed #8614 -- Typo fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8933 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-03 18:44:19 +00:00
Malcolm Tredinnick 63c9b7bf06 Avoid a deprecation warning when running on Python 2.6. Patch from Karen Tracey.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8841 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-02 03:04:28 +00:00
Malcolm Tredinnick cf7a078774 Added a related name to the ForeignKey in the abstract base class of the
comment models. You'll never need to use this name, but it will lead to invalid
models if not present.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8803 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 17:56:22 +00:00
Jacob Kaplan-Moss a3196dac48 Make sure to use force_unicode when looking up comment objects by `object_pk`. Fixes #8762, and one other bug that nobody's reported yet.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8800 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 17:23:09 +00:00
Jacob Kaplan-Moss ae72e25b35 Fixed #8716: correctly handle name and email in comments from authenticated users.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8751 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-30 21:30:02 +00:00
Jacob Kaplan-Moss 7b65302567 Fixed #8608: corrected doc link in comment 400 error page.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8677 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-28 19:46:33 +00:00
Malcolm Tredinnick 65c0846c45 Updated a few save() methods on models to accept force_insert and force_update
parameters. Required as a consequence of [8670] (so they can be used with
create()).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8673 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-28 19:28:17 +00:00
Jacob Kaplan-Moss 08024e9503 Fixed #8601: a small typo in comment views.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8642 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27 22:55:10 +00:00
Jacob Kaplan-Moss 1106c558b1 Fixed #8544: correctly cast `Comment.object_pk` to string when doing lookups. This really only papers over a bigger problem related to casting the RHS of GFKs, but that larger change can wait for a more systematic fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8641 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27 22:51:24 +00:00
Gary Wilson Jr c2ba59fc1d Removed oldforms, validators, and related code:
* Removed `Manipulator`, `AutomaticManipulator`, and related classes.
 * Removed oldforms specific bits from model fields:
   * Removed `validator_list` and `core` arguments from constructors.
   * Removed the methods:
     * `get_manipulator_field_names`
     * `get_manipulator_field_objs`
     * `get_manipulator_fields`
     * `get_manipulator_new_data`
     * `prepare_field_objs_and_params`
     * `get_follow`
   * Renamed `flatten_data` method to `value_to_string` for better alignment with its use by the serialization framework, which was the only remaining code using `flatten_data`.
 * Removed oldforms methods from `django.db.models.Options` class: `get_followed_related_objects`, `get_data_holders`, `get_follow`, and `has_field_type`.
 * Removed oldforms-admin specific options from `django.db.models.fields.related` classes: `num_in_admin`, `min_num_in_admin`, `max_num_in_admin`, `num_extra_on_change`, and `edit_inline`.
 * Serialization framework
   * `Serializer.get_string_value` now calls the model fields' renamed `value_to_string` methods.
   * Removed a special-casing of `models.DateTimeField` in `core.serializers.base.Serializer.get_string_value` that's handled by `django.db.models.fields.DateTimeField.value_to_string`.
 * Removed `django.core.validators`:
   * Moved `ValidationError` exception to `django.core.exceptions`.
   * For the couple places that were using validators, brought over the necessary code to maintain the same functionality.
 * Introduced a SlugField form field for validation and to compliment the SlugField model field (refs #8040).
 * Removed an oldforms-style model creation hack (refs #2160).

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8616 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27 07:19:44 +00:00
Malcolm Tredinnick c305471610 Fixed get_absolute_url() for comments. Previously, it relied on "view on site"
for admin being reversible or required people to set up their own version. Now
we ship a default pattern in the comments URLs in a way that is unlikely to
clash with anything else.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8614 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27 07:04:58 +00:00
Jacob Kaplan-Moss 378f5ddb5a Updated comment signals to provide enough information to actually act on. This was uncovered when working on the documentation, which'll be committed shortly.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8589 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-26 18:53:52 +00:00
Malcolm Tredinnick ccb37ce74c The comments app was unconditionally accessing various settings that didn't
exist in Django's global settings. Changed those accesses to conditional
lookups with default fallbacks.

The comment_test tests now pass without needing to add any extra settings.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8573 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-26 06:58:43 +00:00