Commit Graph

104 Commits

Author SHA1 Message Date
Andrew Godwin 4a9ecdb148 Fixed #14995 -- Add FormView import to generic views __init__. Thanks carbonXT.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15160 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-08 14:53:44 +00:00
Andrew Godwin 32a344dfe2 Fixed inconsistency in ListView's pagination (short datasets should also trigger a pagination, but with a single possible page)
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15155 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-08 13:15:44 +00:00
Russell Keith-Magee a00e8d4e42 Fixed #14878 -- Clarified the way verbose_name_plural is used in generic list views as a context variable. Thanks to diegueus9 for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15133 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-03 13:15:58 +00:00
Chris Beaven 2e909489d7 Add FormMixin.get_form_kwargs method to abstract some common logic in a tidier
way. Tidy up (and amend) documentation about FormMixin and ModelFormMixin.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14865 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-10 03:51:30 +00:00
Chris Beaven ff8711a825 Fixes #14873 -- A paginated ListView with a List instead of queryset produces an error.
Additional minor change in functionality: the page is now not considered paginated if the objects do not span multiple pages according to the paginator. This will only affect views with a custom paginator method which uses orphans.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14864 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-09 02:34:14 +00:00
Russell Keith-Magee e0dcd7666a Fixed #12815 -- Added TemplateResponse, a lazy-evaluated Response class. Thanks to Simon Willison for the original idea, and to Mikhail Korobov and Ivan Sagalaev for their assistance, including the draft patch from Mikhail.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14850 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-07 13:57:01 +00:00
Russell Keith-Magee ee48da2405 Fixed #14773 -- Modified MultipleObjectMixin to allow for custom paginators. Thanks to piquadrat for the report and initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14828 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-05 04:32:36 +00:00
Russell Keith-Magee adfd7f8172 Fixed #14797 -- Corrected the handling of get_form_class() when a custom queryset has been defined, but a model hasn't. Thanks to Gabriel Grant for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-04 11:20:52 +00:00
Russell Keith-Magee 324658ef26 Fixed #14803 -- Corrected an inconsistency in redirection handling between old-style generic views and class-based views. Thanks to gg for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14808 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-04 11:20:30 +00:00
Russell Keith-Magee 2efb4757af Fixed #14752 -- Corrected date parsing in WeekArchiveView when using %W as a week format. Thanks to msundstr for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14684 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-23 01:46:48 +00:00
Luke Plant d4c6abcbd1 Documented migration path for change object_list -> ListView regarding different context variables
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14650 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-20 20:38:52 +00:00
Russell Keith-Magee 591ad8afbf Fixed #14512 -- Added documentation on how to apply decorators to class-based generic views. Thanks to Łukasz Rekucki for his work on the issue.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14642 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-20 05:10:13 +00:00
Russell Keith-Magee 4c9741cba2 Fixed #14558 -- Modified the way PUT and DELETE HTTP methods are handled so that overridden methods will get used correctly. Thanks to pyrou for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14374 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-28 02:59:04 +00:00
Russell Keith-Magee 623592e0ac Fixed #14554 -- Raise the actual NotImplementedError exception, not the NotImplemented comparison value. Thanks to mattmcc for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14373 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-28 02:58:46 +00:00
Russell Keith-Magee baa1e90d4c Fixed #14504 -- Corrected the way object_list is used in ListView to avoid overwriting context. Includes improved usage of unittest2 assertions. Thanks to Łukasz Rekucki for the final patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14372 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-28 02:58:28 +00:00
Russell Keith-Magee 8bc2f2a0b5 Fixed #14568 -- Use keyword rather than positional arguments for form construction. Thanks to mattmcc for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14371 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-28 02:58:06 +00:00
Russell Keith-Magee a014ee0288 Modified the implementation of get_object() to be consistent with the approach used elsewhere in the API. Also added documentation for get_object() which seems to have been accidentally omitted.
This is a BACKWARDS-INCOMPATIBLE CHANGE for anyone depending on the API for get_object() that was introduced (but not documented) in r14254.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14292 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-20 00:21:47 +00:00
Honza Král 1a270bd103 Fixed #14495 -- DeletionMixin and FormMixin don't have an object to work with so they cannot redirect to get_absolute_url and shouldn't claim they do.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14284 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-19 07:22:38 +00:00
Russell Keith-Magee 3ecc84a83c Added a logging call on HTTP 405 for class-based views. This is for consistency with function-based views.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14273 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-19 00:26:15 +00:00
Russell Keith-Magee 0fcb094557 Fixed #6735 -- Added class-based views.
This patch is the result of the work of many people, over many years.
To try and thank individuals would inevitably lead to many people
being left out or forgotten -- so rather than try to give a list that
will inevitably be incomplete, I'd like to thank *everybody* who
contributed in any way, big or small, with coding, testing, feedback
and/or documentation over the multi-year process of getting this into
trunk.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14254 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-18 13:34:47 +00:00
Russell Keith-Magee fea159282b Fixed #14406 -- Added a Python 2.4 compatibility to the logging interface. Thanks to Łukasz Rekucki for the report, and to Luke Plant for original patch this was based on.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13989 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-06 15:02:26 +00:00
Russell Keith-Magee 24acca4139 Fixed #12012 -- Added support for logging. Thanks to Vinay Sajip for his draft patch, and to the many people who gave feedback during development of the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13981 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-04 15:12:39 +00:00
Malcolm Tredinnick fffe0a00a3 Add option to redirect_to view to allow passing along the query string
from the original request. Default is current behaviour, which is not to
pass the query string (it often won't be appropriate to do so).

Thanks to steingrd@ifi.uio.no for the patch and tests. Fixed #9966.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13746 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-11 03:13:23 +00:00
Karen Tracey b45fd3ffdf Fixed: 3274: Added date_list context variable to the archive_month generic view, consistent with archive_index and archive_year. Thanks Sean Brant.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12195 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-10 19:52:17 +00:00
Adrian Holovaty 5ceed0a053 Changed a whole bunch of places to raise exception instances instead of old-style raising exception classes plus a comma. Good for the future Python 3 conversion
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12180 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-10 18:36:20 +00:00
Luke Plant 25020ddb05 Fixed #4604 - Configurable message passing system, supporting anonymous users
This deprecates User.message_set in favour of a configurable messaging
system, with backends provided for cookie storage, session storage and
backward compatibility.

Many thanks to Tobias McNulty for the bulk of the work here, with
contributions from Chris Beaven (SmileyChris) and lots of code review from
Russell Keith-Magee, and input from many others.  Also credit to the authors
of various messaging systems for Django whose ideas may have been pinched
:-)



git-svn-id: http://code.djangoproject.com/svn/django/trunk@11804 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-09 16:57:23 +00:00
Karen Tracey 50745cc31e Fixed #11066 -- Corrected 15 duplicate "the"s found in docs and code comments. Thanks kaikuehne.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10801 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-17 16:45:28 +00:00
Russell Keith-Magee 6cc0c3887c Fixed #10458 -- Corrected the `next_month` and `previous_month` context variables provided with the generic month_archive view. The value returned now matches the docstring and the generic views documentation. Thanks to fperetti for the report and initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10556 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-13 13:23:03 +00:00
Jacob Kaplan-Moss 641c5fd3b5 Fixed #7944: date-based generic views no longer get confused with a numeric month format. Thanks to Justin Lilly and Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10457 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-09 15:23:56 +00:00
Adrian Holovaty b76d7c1dec Added a 'permanent' argument the simple.redirect_to() generic view. It's True by default, to match existing behavior. If set to False, the redirect will be a 302 instead of a 301. This is technically backwards-incompatible if you were using the redirect_to generic view with a format-string key called 'permanent', which is highly, highly unlikely.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9594 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-08 04:53:34 +00:00
Brian Rosner a64dc39fb7 Fixed #7602 -- Corrected lookup keyword arguments in archive_month and archive_week to properly range when date_field is from DateField. Thanks nullie for the original patch and Colin Grady for the test coverage.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8476 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23 04:46:33 +00:00
Gary Wilson Jr ef48a3e69c Fixed #7830 -- Removed all of the remaining, deprecated, non-oldforms features:
* Support for representing files as strings was removed. Use `django.core.files.base.ContentFile` instead.
 * Support for representing uploaded files as dictionaries was removed. Use `django.core.files.uploadedfile.SimpleUploadedFile` instead.
 * The `filename`, `file_name`, `file_size`, and `chuck` properties of `UploadedFile` were removed. Use the `name`, `name`, `size`, and `chunks` properties instead, respectively.
 * The `get_FIELD_filename`, `get_FIELD_url`, `get_FIELD_size`, and `save_FIELD_file` methods for Models with `FileField` fields were removed. Instead, use the `path`, `url`, and `size` attributes and `save` method on the field itself, respectively.
 * The `get_FIELD_width` and `get_FIELD_height` methods for Models with `ImageField` fields were removed. Use the `width` and `height` attributes on the field itself instead.
 * The dispatcher `connect`, `disconnect`, `send`, and `sendExact` functions were removed. Use the signal object's own `connect`, `disconnect`, `send`, and `send` methods instead, respectively.
 * The `form_for_model` and `form_for_instance` functions were removed. Use a `ModelForm` subclass instead.
 * Support for importing `django.newforms` was removed. Use `django.forms` instead.
 * Support for importing `django.utils.images` was removed. Use `django.core.files.images` instead.
 * Support for the `follow` argument in the `create_object` and `update_object` generic views was removed. Use the `django.forms` package and the new `form_class` argument instead.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8291 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-10 21:10:47 +00:00
Gary Wilson Jr 4774c8d673 Corrected spacing in warning message.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8106 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-27 17:25:37 +00:00
Gary Wilson Jr 020f965087 Fixed #7988 -- Corrected import of the warnings module, thanks richardh.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8105 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-27 17:24:35 +00:00
Adrian Holovaty 29f0e8182f Fixed #7847 -- Removed a whole bunch of unused imports from throughout the codebase. Thanks, julien
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8046 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-22 03:24:09 +00:00
Jacob Kaplan-Moss 46786b4193 Fixed #7741: django.newforms is now django.forms. This is obviously a backwards-incompatible change. There's a warning upon import of django.newforms itself, but deeper imports will raise errors.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7971 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-19 01:22:26 +00:00
Gary Wilson Jr dc375fb0f3 Refs #3639 -- Minor docstring correction, it's a function not a method.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7966 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-18 23:52:18 +00:00
Jacob Kaplan-Moss 7997133a3d Fixed #3639: updated generic create_update views to use newforms. This is a backwards-incompatible change.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7952 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-18 19:45:00 +00:00
Malcolm Tredinnick 409ed9468f Fixed #7670 -- Fixed a couple of missed changes from [7865]. Patch from jshaffer.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7869 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-08 05:29:23 +00:00
Adrian Holovaty 4406d283e1 Fixed #7478 -- Rolled QuerySetPaginator into the Paginator class, to simplify things. QuerySetPaginator still exists as an alias, for backwards compatibility. Thanks for the suggestion, batiste@dosimple.ch
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7865 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-08 02:08:33 +00:00
Malcolm Tredinnick 0fea1348d6 Fixed #6846 -- Fixed first_on_page and last_on_page in list_detail generic
view. Thanks, trevor.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7352 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-23 05:45:59 +00:00
Adrian Holovaty 08d4910d69 Changed list_detail.object_list generic view to use the new Paginator class. This is backwards-compatible -- the previous 12 template context variables (has_next, has_previous, etc.) are still passed to the template, but new templates should only access the new template variables 'paginator' and 'page_obj'
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7307 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-18 21:40:45 +00:00
Malcolm Tredinnick 9075ac4b76 Fixed #685 -- archive_index() and object_list() generic views allow empty
result sets by default now. Thanks, Gary Wilson and Matt Croydon.

This is a backwards incompatible change.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6833 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-02 15:43:35 +00:00
Russell Keith-Magee b361947745 Fixed #5468 -- Fixed the handling of the context argument in direct_to_template generic views. Thanks, durdinator.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6278 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 11:12:54 +00:00
Russell Keith-Magee 2bec822ff3 Fixed #3895 -- Added ability to customize the context variable in the archive_index generic view. Thanks to marco.giusti@gmail.com and toke-django@toke.de.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6157 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 03:54:28 +00:00
Russell Keith-Magee d14c756b5e Fixed #4919 -- Added 'last' marker on paginators. Thanks to patrick@vonautomatisch.atfor the idea, and nick@efford.org for the patch and docs.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6149 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 01:52:10 +00:00
Russell Keith-Magee 87e77ffca0 Fixed #1795 -- Added page_range to paginators in generic list views. Thanks to polarcowz@gmail.com and Marc Fargas <telenieko@telenieko.com> for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6146 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 01:01:02 +00:00
Gary Wilson Jr be39adeb28 Changed imports to adhere to PEP 8.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6058 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-07 04:11:20 +00:00
Gary Wilson Jr da5ce52061 Fixed #3134 -- Made the `archive_year` generic view consistent with the other date-based generic views by not performing an `order_by()` on the passed queryset. This change is backwards-incompatible if you were relying on `archive_year` to do the ordering for you.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6057 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-07 04:09:59 +00:00
Malcolm Tredinnick 56e28b4e8f Fixed #5085 -- In generic views, set the default name for the slug field to 'slug'. Thanks, Trevor Caira.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5877 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-12 12:59:41 +00:00