Commit Graph

70 Commits

Author SHA1 Message Date
Tim Graham 7b69c3e775 Removed versionadded/changed annotations for 1.5 2013-08-19 09:09:41 -04:00
Anssi Kääriäinen 3844089edc Fixed #20777 -- Admin proxy model deletion regression
Added proxy_models tests by Harm Geerts <github@geertswei.nl>.
2013-08-19 09:51:41 +03:00
Anssi Kääriäinen 4668c142dc Made Model.__eq__ consider proxy models equivalent
Fixed #11892, fixed #16458, fixed #14492.
2013-08-19 09:51:28 +03:00
Jimmy Song 94d7fed775 Fixed #20859 - Clarified Model.clean() example. 2013-08-05 09:06:09 -04:00
Julien Phalip 47c755327b Fixed a number of minor misspellings. 2013-07-27 18:46:03 -07:00
Claude Paroz 7442eb1a24 Fixed #20224 -- Update docs examples which mention __unicode__
Thanks Marc Tamlyn and Tim Graham for the review.
2013-07-05 19:27:07 +02:00
James Bennett ba610cb319 Fixed #19881 -- Documented that get_next/previous_by_FOO uses default manager. 2013-06-21 13:14:05 -04:00
Loic Bistuer ee77d4b253 Fixed #20199 -- Allow ModelForm fields to override error_messages from model fields 2013-06-18 08:01:17 -04:00
Marc Egli e4591debd1 Add missing imports and models to the examples in the the model layer documentation 2013-05-18 18:38:52 +02:00
Juan Catalano 78c842a323 Adapted uses of versionchanged/versionadded to the new form.
Refs #20104.
2013-04-20 17:18:35 +02:00
Anssi Kääriäinen 6b4834952d Fixed #16649 -- Refactored save_base logic
Model.save() will use UPDATE - if not updated - INSERT instead of
SELECT - if found UPDATE else INSERT. This should save a query when
updating, but will cost a little when inserting model with PK set.

Also fixed #17341 -- made sure .save() commits transactions only after
the whole model has been saved. This wasn't the case in model
inheritance situations.

The save_base implementation was refactored into multiple methods.
A typical chain for inherited save is:
save_base()
    _save_parents(self)
        for each parent:
            _save_parents(parent)
            _save_table(parent)
    _save_table(self)
2013-03-14 11:01:47 +02:00
Tim Graham 43f89e0ad6 Fixed #19605 - Removed unused url imports from doc examples.
Thanks sergzach for the suggestion.
2013-01-15 07:50:26 -05:00
Tim Graham b3a8c9dab8 Fixed broken links, round 3. refs #19516 2012-12-26 19:07:22 -05:00
Jason Yan eeaab083fe Fixed #19374 -- Typo in docs/ref/models/instances.txt. 2012-11-27 18:57:50 -08:00
Tim Graham 0e3690d230 Fixed #18974 - Warned against using models.permalink
Thanks dstufft for the draft patch.
2012-11-22 16:08:51 -05:00
Tim Graham d3fd8a1512 Fixed #15591 - Clarified interaction between ModelForm and model validation. 2012-11-05 18:24:28 -05:00
Eric Davis d94dc2d1fa Fixed formatting of get_FOO_display example 2012-11-04 10:29:10 -08:00
Ramiro Morales ec1aad1671 Added section about URL reversion to URL mapper document. 2012-10-07 20:21:07 -03:00
Anssi Kääriäinen dad7eec6e1 Corrected links to only()/defer() in Model documentation
Refs #18306
2012-09-30 02:45:50 +03:00
Aymeric Augustin e69348b4e7 Avoided mixing dates and datetimes in the examples.
Refs #16023.
2012-09-08 11:00:04 -04:00
Alex Gaynor 17d57275f9 Fixed #18883 -- added a missing self parameter in the docs 2012-08-30 19:19:11 -07:00
Claude Paroz ebc773ada3 Replaced many smart_bytes by force_bytes
In all those occurrences, we didn't care about preserving the
lazy status of the strings, but we really wanted to obtain a
real bytestring.
2012-08-29 11:20:32 +02:00
Andrei Antoukh 99321e30ce Fixed #18306 -- Made deferred models issue update_fields on save
Deferred models now automatically update only the fields which are
loaded from the db (with .only() or .defer()). In addition, any field
set manually after the load is updated on save.
2012-08-12 22:39:27 +03:00
Aymeric Augustin c5ef65bcf3 [py3] Ported django.utils.encoding.
* Renamed smart_unicode to smart_text (but kept the old name under
  Python 2 for backwards compatibility).
* Renamed smart_str to smart_bytes.
* Re-introduced smart_str as an alias for smart_text under Python 3
  and smart_bytes under Python 2 (which is backwards compatible).
  Thus smart_str always returns a str objects.
* Used the new smart_str in a few places where both Python 2 and 3
  want a str.
2012-08-07 12:00:22 +02:00
Tim Graham 7313468f85 Fixed #17436 - Added warning about overriding Model.__init__()
Thanks zsiciarz for the draft patch.
2012-07-01 18:04:16 -04:00
Aymeric Augustin c28e700c7e Removed references to changes made in 1.2.
Thanks Florian Apolloner for the patch.
2012-06-07 15:02:35 +02:00
Jacob Kaplan-Moss 7edf231d46 Replaced documentation snippets using "gender" with less sensitive examples. 2012-06-06 13:52:53 +02:00
Andrei Antoukh 365853da01 Fixed #4102 -- Allow update of specific fields in model.save()
Added the ability to update only part of the model's fields in
model.save() by introducing a new kwarg "update_fields". Thanks
to all the numerous reviewers and commenters in the ticket
2012-05-12 10:29:41 +03:00
Claude Paroz 596cb9c7e2 Replaced print statement by print function (forward compatibility syntax). 2012-04-30 20:45:03 +02:00
Claude Paroz 3904b74a3f Fixed #18013 -- Use the new 'as' syntax for exceptions.
Thanks Clueless for the initial patch.
Note that unittest has been purposely left out (external package only used by Python 2.6).
2012-04-29 20:57:15 +02:00
Aymeric Augustin e1a31aadb0 Fixed an inappropriate repetition. Thanks DanGer for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17679 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-03-11 11:49:38 +00:00
Luke Plant d1e5c55258 Fixed many more ReST indentation errors, somehow accidentally missed from [16955]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16983 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-14 00:12:01 +00:00
Ramiro Morales 26b8122087 Fixed #14675 -- Completed removal of `from django.conf.urls.default import *` usage.
This applies to both our own [test] code and documentation examples. Also:
 * Moved the functions and handlers from `django.conf.urls.defaults` up to
   `django.conf.urls` deprecating the former module.
 * Added documentation for `handler403`.
 * Tweaked the URLs topic document a bit.

Thanks to pupeno and cdestigter for their great work contributing patches.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16818 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-09-11 22:36:16 +00:00
James Bennett f6d11f9b05 Fixed #16109: Corrected an inconsistency in URLconf examples for matching a numeric month.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16811 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-09-11 05:44:21 +00:00
Ramiro Morales 932b1b8d6d Converted links to external topics so they use intersphinx extension markup.
This allows to make these links more resilent to changes in the target URLs.
Thanks Jannis for the report and Aymeric Augustin for the patch.

Fixes #16586.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16720 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-09-04 21:17:30 +00:00
Malcolm Tredinnick 77189afb7f Slightly rewrite @permalink and get_absolute_url() documentation.
Part 2 of the model instance documentation changes. Slightly tidied up
get_absolute_url() and @permalink documentation to collapse some of the
earlier versions into a preferred learning order. I'm still not
amazingly happy with this, but larger rewrites are needed to the URLconf
stuff across a few files before I can get it into the most natural
order, I suspect. That's a slightly longer-term project.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16702 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-08-28 02:05:32 +00:00
Malcolm Tredinnick a0eb58e90b Documentation edits for model instance docs.
First of two parts. Mostly adding cross references to other parts of the
documentation.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16701 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-08-28 02:05:20 +00:00
Timo Graham caefdc8246 Fixed #16090, #16091, #16114 - Typos in docs; thanks teraom.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16300 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-31 09:42:19 +00:00
Timo Graham 2ea93f9327 Fixed #14000 - remove versionadded/changed tags for Django 1.0 and 1.1
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15055 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-26 00:37:14 +00:00
Gabriel Hurley 7f2b36050e Fixed #10904 -- Corrected inappropriate usage of the term "absolute URL" throughout the docs. Replaced with the (RFC 2396-compliant) terms "absolute path reference" or "absolute path" as appropriate for the context. Thanks to sharan666 for the report, and Malcolm, Chris, and dwillis for their work in supplying a solution and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14482 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-07 01:42:55 +00:00
Gabriel Hurley e9d6662f5e Fixed #14493 -- Corrected use of the wrong attribute in the model validation example pseudo-code. Thanks to wogan for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14300 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-20 21:08:06 +00:00
Russell Keith-Magee a904e55859 Fixed #11509 -- Modified usage of "Web" to match our style guide in various documentation, comments and code. Thanks to timo and Simon Meers for the work on the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14069 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-09 08:12:50 +00:00
Malcolm Tredinnick 9802a73e25 Better error message for calling get_next_by_* on unsaved models.
Patch from Marc Fargas. Fixed #7435.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13738 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-11 00:20:35 +00:00
Luke Plant 58c8d92334 Fixed #14189 - permalink docs import mistake
Thanks to 7times9 for report and patch.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@13666 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-30 10:29:44 +00:00
Jacob Kaplan-Moss 728effcfbd Fixed #14141: docs now use the :doc: construct for links between documents.
Thanks, Ramiro Morales.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13608 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-19 19:27:44 +00:00
Karen Tracey 2fce843832 Fixed import example code for NON_FIELD_ERRORS.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13434 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-07-17 09:29:44 +00:00
Karen Tracey fc33b8e953 Fixed #13778: Removed a stray colon in a code example. Thanks canassa.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13355 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-06-17 18:29:27 +00:00
Russell Keith-Magee 4a15dc4509 Fixed #13100 -- Clarified the model validation rules around full_clean(). Thanks to ptone for the draft text.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13160 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-09 05:47:35 +00:00
Jannis Leidel f56f6e9405 Fixed #9326 - Use decorator syntax in get_absolute_url example. Thanks, timo.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12222 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-12 23:37:07 +00:00
Joseph Kocherhans c4ad3dede1 Fixed #12586. Corrected a typo in the validation docs. Thanks, phyfus.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12209 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-12 14:04:04 +00:00