Commit Graph

2190 Commits

Author SHA1 Message Date
Marc Tamlyn 16f3a6a4c7 Fixed #21865 -- Incorrect signs in documented example.
Maths is hard.
2014-01-23 20:32:24 +00:00
Baptiste Mispelon d7ce48f175 Fixed #21864 -- Fixed missing quote in custom lookup example.
Thanks to Chris Barna for the report.
2014-01-23 16:13:20 +01:00
Tim Graham 81830ce34f Fixed some punctuation; thanks Chris Jerdonek. 2014-01-23 09:01:26 -05:00
Baptiste Mispelon 05d36dc06e Always use parentheses when documenting a method with no arguments. 2014-01-22 22:26:10 +01:00
Baptiste Mispelon 79e1d6ebd7 Don't show `self` in the list of arguments of a method.
This is consistent with Python's official documentation
and it's a sphinx recommendation too[1].

[1] http://sphinx-doc.org/markup/desc.html#dir-method

Refs #21855.
2014-01-22 22:17:32 +01:00
Tim Graham dfc092622e Fixed #21529 -- Noted that {% url %} encodes its output (refs #13260). 2014-01-22 10:44:50 -05:00
Tim Graham 03395b4277 Fixed some markup that caused broken links in the static files docs. 2014-01-22 10:15:27 -05:00
Jannis Leidel 8efd20f96d Added ManifestStaticFilesStorage to staticfiles contrib app.
It uses a static manifest file that is created when running
collectstatic in the JSON format.
2014-01-20 19:32:07 +01:00
Russell Keith-Magee e8920e96d0 Added a missing command to the command line examples for check.
Thanks to Bruno Renie for the report.
2014-01-20 20:46:21 +08:00
Russell Keith-Magee b0602e935c Corrected documentation typo.
Thanks to @cjerdonek for the report.
2014-01-20 19:48:06 +08:00
Russell Keith-Magee 9ddc358e8d Corrected minor typo.
Thanks to @cjerdonek for the report.
2014-01-20 13:13:16 +08:00
Russell Keith-Magee d818e0c9b2 Fixed #16905 -- Added extensible checks (nee validation) framework
This is the result of Christopher Medrela's 2013 Summer of Code project.

Thanks also to Preston Holmes, Tim Graham, Anssi Kääriäinen, Florian
Apolloner, and Alex Gaynor for review notes along the way.

Also: Fixes #8579, fixes #3055, fixes #19844.
2014-01-20 10:45:21 +08:00
Tim Graham 6e7bd0b63b Fixed some admin sphinx definitions so links work properly. 2014-01-19 20:29:09 -05:00
Andrew Godwin c9de1b4a55 Implement swappable model support for migrations 2014-01-19 16:43:12 +00:00
Aymeric Augustin 10e0cfc0e4 Fixed #21712 -- Moved autodiscover() to AdminConfig.ready().
Thanks Marc Tamlyn for the initial version of the patch.
2014-01-18 23:06:00 +01:00
Anssi Kääriäinen 4dc3be2506 Fixed typos spotted by Claude Paroz 2014-01-18 22:31:35 +02:00
Anssi Kääriäinen 20bab2cf9d Fixed #16187 -- refactored ORM lookup system
Allowed users to specify which lookups or transforms ("nested lookus")
are available for fields. The implementation is now class based.

Squashed commit of the following:

commit fa7a7195f1
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 18 10:53:24 2014 +0200

    Added lookup registration API docs

commit eb1c8ce164
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Tue Jan 14 18:59:36 2014 +0200

    Release notes and other minor docs changes

commit 11501c29c9
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Jan 12 20:53:03 2014 +0200

    Forgot to add custom_lookups tests in prev commit

commit 83173b960e
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Jan 12 19:59:12 2014 +0200

    Renamed Extract -> Transform

commit 3b18d9f3a1
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Jan 12 19:51:53 2014 +0200

    Removed suggestion of temporary lookup registration from docs

commit 21d0c7631c
Merge: 2509006 f2dc442
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Jan 12 09:38:23 2014 -0800

    Merge pull request #2 from mjtamlyn/lookups_3

    Reworked custom lookups docs.

commit f2dc4429a1
Author: Marc Tamlyn <marc.tamlyn@gmail.com>
Date:   Sun Jan 12 13:15:05 2014 +0000

    Reworked custom lookups docs.

    Mostly just formatting and rewording, but also replaced the example
    using ``YearExtract`` to  use an example which is unlikely to ever be
    possible directly in the ORM.

commit 2509006506
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Jan 12 13:19:13 2014 +0200

    Removed unused import

commit 4fba5dfaa0
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 22:34:41 2014 +0200

    Added docs to index

commit 6d53963f37
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 22:10:24 2014 +0200

    Dead code removal

commit f9cc039007
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 19:00:43 2014 +0200

    A new try for docs

commit 33aa18a6e3
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 14:57:12 2014 +0200

    Renamed get_cols to get_group_by_cols

commit c7d5f8661b
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 14:45:53 2014 +0200

    Altered query string customization for backends vendors

    The new way is trying to call first method 'as_' + connection.vendor.
    If that doesn't exist, then call as_sql().

    Also altered how lookup registration is done. There is now
    RegisterLookupMixin class that is used by Field, Extract and
    sql.Aggregate. This allows one to register lookups for extracts and
    aggregates in the same way lookup registration is done for fields.

commit 90e7004ec1
Merge: 66649ff f7c2c0a
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 13:21:01 2014 +0200

    Merge branch 'master' into lookups_3

commit 66649ff891
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Jan 11 13:16:01 2014 +0200

    Some rewording in docs

commit 31b8faa627
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Dec 29 15:52:29 2013 +0200

    Cleanup based on review comments

commit 1016159f34
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Dec 28 18:37:04 2013 +0200

    Proof-of-concept fix for #16731

    Implemented only for SQLite and PostgreSQL, and only for startswith
    and istartswith lookups.

commit 193cd097ca
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Dec 28 17:57:58 2013 +0200

    Fixed #11722 -- iexact=F() produced invalid SQL

commit 08ed3c3b49
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Dec 21 23:59:52 2013 +0200

    Made Lookup and Extract available from django.db.models

commit b99c8d83c9
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Dec 21 23:06:29 2013 +0200

    Fixed review notes by Loic

commit 049eebc070
Merge: ed8fab7 b80a835
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Dec 21 22:53:10 2013 +0200

    Merge branch 'master' into lookups_3

    Conflicts:
    	django/db/models/fields/__init__.py
    	django/db/models/sql/compiler.py
    	django/db/models/sql/query.py
    	tests/null_queries/tests.py

commit ed8fab7fe8
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Dec 21 22:47:23 2013 +0200

    Made Extracts aware of full lookup path

commit 27a57b7aed
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Dec 1 21:10:11 2013 +0200

    Removed debugger import

commit 074e0f5aca
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Dec 1 21:02:16 2013 +0200

    GIS lookup support added

commit 760e28e72b
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Dec 1 20:04:31 2013 +0200

    Removed usage of Constraint, used Lookup instead

commit eac4776684
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Dec 1 02:22:30 2013 +0200

    Minor cleanup of Lookup API

commit 2adf50428d
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sun Dec 1 02:14:19 2013 +0200

    Added documentation, polished implementation

commit 32c04357a8
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Nov 30 23:10:15 2013 +0200

    Avoid OrderedDict creation on lookup aggregate check

commit 7c8b3a32cc
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Nov 30 23:04:34 2013 +0200

    Implemented nested lookups

    But there is no support of using lookups outside filtering yet.

commit 4d219d4cde
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Wed Nov 27 22:07:30 2013 +0200

    Initial implementation of custom lookups
2014-01-18 11:46:19 +02:00
Tim Graham b87c59b04b Removed some unnecessary __exact operators in filters. 2014-01-17 18:12:45 -05:00
Tim Graham bc7668eb51 Fixed #18942 -- Clarified usage of {% get_static_prefix %}.
Thanks Aymeric for the suggestion.
2014-01-17 16:06:11 -05:00
Tim Graham 4a5aac47a6 Fixed #13116 -- Described scope of variables created by {% url ... as var %} syntax.
Thanks leif_p for the suggestion.
2014-01-17 14:50:47 -05:00
Tim Graham 9173d2cb74 Fixed #18285 -- Documented that bulk_create doesn't work with M2M relationships. 2014-01-16 20:47:02 -05:00
Tim Graham a6e3fb80b0 Fixed #21343 -- Noted many-to-many restrictions with intermediate model.
Thanks EvilDMP for the report.
2014-01-16 08:38:40 -05:00
Tim Graham c05b2f58e7 Fixed #21768 -- Corrected TemplateView context section.
Thanks nedbatchelder for the report and claudep for the patch.
2014-01-16 07:58:08 -05:00
Kevin Wood 82f466b571 Fix typo in storage docs 2014-01-15 13:17:08 -08:00
Aymeric Augustin d562527a16 Fixed #21477 -- Renamed db to using in pre/post_migrate signals. 2014-01-12 22:24:33 +01:00
Claude Paroz 3d4ed28dce Fixed #21547 -- Updated GeoDjango tutorial with PostGIS 2 output
Thanks awilliams at cironline.org for the report.
2014-01-11 17:58:29 +01:00
Claude Paroz 0179852d7f Fixed #8898 -- Obsoleted SplitDateTimeWidget usage with DateTimeField
Thanks Tim Graham for the review.
2014-01-11 15:50:34 +01:00
Aymeric Augustin 3326a412cc Deprecated importing a model before loading its application.
Refs #21719, #21680.
2014-01-10 23:43:10 +01:00
Aymeric Augustin 6a320cc14a Fixed #21718 -- Renamed has_app to is_installed. 2014-01-06 22:48:41 +01:00
Vajrasky Kok ea83102d0f Fixed #21319 -- Added documentation for the Form.fields attribute.
Thanks pydanny for the report. Also, added documentation about
base_fields attribute and its difference with fields attribute.
2014-01-02 19:43:26 -05:00
Aymeric Augustin 449ede03b8 Changed convention for modules storing AppConfigs.
The app/apps dichotomy was more confusing than valuable.
2014-01-02 23:07:33 +01:00
Nathan Smith 44d40ba521 Fixed minor typos. 2014-01-02 15:14:11 -05:00
Aymeric Augustin 1386075f62 Updated release notes on app_label.
Django determines automatically which application models belong to,
provided the application can be imported without importing models.
2014-01-01 19:45:43 +01:00
Aymeric Augustin 0ce945a671 Fixed #21018 -- Reversed precedence order for management commands. 2014-01-01 18:11:15 +01:00
Aymeric Augustin 8a2f304a79 Documented unicity rules in INSTALLED_APPS.
Refs #12288, #21679.
2014-01-01 16:51:58 +01:00
Loic Bistuer 4befb3015c Fixed #21581 -- Fixed a number of issues with collectstatic.
When STATIC_ROOT wasn't set, collectstatic --clear would delete
every files within the current directory and its descendants.

This patch makes the following changes:

Prevent collectstatic from running if STATIC_ROOT isn't set.

Fixed an issue that prevented collectstatic from displaying the
destination directory.

Changed the warning header to notify when the command is run
in dry-run mode.
2013-12-31 14:58:49 -05:00
Aymeric Augustin 1d23d766ab Renamed AppConfig.setup to ready.
Thanks Jannis and Marc for the feedback.

Fixed #21717.
2013-12-31 18:04:54 +01:00
Aymeric Augustin c40209dcc0 Made it possible to change an application's label in its configuration.
Fixed #21683.
2013-12-31 17:30:58 +01:00
Aymeric Augustin bfcc686d22 Removed the only_with_models_module argument of get_model[s].
Now that the refactorings are complete, it isn't particularly useful any
more, nor very well named. Let's keep the API as simple as possible.

Fixed #21689.
2013-12-30 23:59:34 +01:00
Tim Graham 0150830687 Fixed #21710 -- Documented User.get_short_name()
Thanks Keryn Knight for the report.
2013-12-30 17:42:11 -05:00
Aymeric Augustin 80d74097b4 Stopped populating the app registry as a side effect.
Since it triggers imports, it shouldn't be done lightly.

This commit adds a public API for doing it explicitly, django.setup(),
and does it automatically when using manage.py and wsgi.py.
2013-12-30 22:11:17 +01:00
Aymeric Augustin c31d7c4813 Updated advice on connecting signals at startup. 2013-12-30 22:11:17 +01:00
Aymeric Augustin e187caa3af Added AppConfig.setup() to run setup code. 2013-12-30 22:11:16 +01:00
Aymeric Augustin 7b88a96553 Added AppConfig.get_models(). 2013-12-29 20:31:59 +01:00
Aymeric Augustin 00110904ac Refactored the migration signals to use app configs.
De-aliased pre/post_syncdb to pre/post_migrate to increase
backwards-compatibility.
2013-12-29 17:53:42 +01:00
Claude Paroz 6d66ba5948 Fixed #21242 -- Allowed more IANA schemes in URLValidator
Thanks Sascha Peilicke for the report and initial patch, and
Tim Graham for the review.
2013-12-28 21:25:32 +01:00
Aymeric Augustin ba7206cd81 Changed get_model to raise an exception on errors.
Returning None on errors required unpythonic error checking and was
inconsistent with get_app_config.

get_model was a private API until the previous commit, but given that it
was certainly used in third party software, the change is explained in
the release notes.

Applied the same change to get_registered_model, which is a new private
API introduced during the recent refactoring.
2013-12-28 20:53:00 +01:00
Aymeric Augustin 54790e669d Simplified Apps.get_model and added AppConfig.get_model.
Documented them as public APIs.
2013-12-28 20:43:29 +01:00
Claude Paroz b7a7baa554 Fixed #21618 -- Added hints about openlayers.js hosting
Thanks kz26 for the report and Tim Graham for the excellent
review.
2013-12-28 11:08:50 +01:00
Aymeric Augustin c81fae6b95 Used app_label instead of appname.
The last component of the dotted path to the application module is
consistently referenced as the application "label". For instance it's
AppConfig.label. appname could be confused with AppConfig.name, which is
the full dotted path.
2013-12-28 09:53:02 +01:00
Tim Graham d8d83777eb Fixed #21629 -- Added instructions for loading MySQL time zone definitions.
Thanks Aymeric for the suggestion.
2013-12-26 15:50:33 -05:00
Aymeric Augustin ce1bc2c94b Made the AppConfig API marginally more consistent.
Eliminated the app_ prefix that was more confusing than useful.
2013-12-26 19:25:09 +01:00
Aymeric Augustin 7df049c417 Swapped app registry and app config API docs.
Thanks David Larlet for the suggestion.

Also fixed some Sphinx warnings and improved ReST markup.
2013-12-25 21:57:52 +01:00
Yaroslav Halchenko 80027d2c38 Unified listing of shell commands/code
- use code-block:: bash
- prefix the command with $
2013-12-25 15:19:14 -05:00
Tim Graham b798d2bf97 Added versionadded annotations for redirect middleware attributes.
refs #19321
2013-12-25 09:56:41 -05:00
Tim Graham 5d82658657 Fixed #21669 -- Typo in docs/ref/forms/fields.txt.
Thanks alex_koval for the report.
2013-12-25 06:02:43 -05:00
Aymeric Augustin 8c78cba47f Copy-edited previous commit.
Thanks Tim for the review.
2013-12-24 23:48:22 +01:00
Aymeric Augustin 285e765891 Added release notes for app loading changes. 2013-12-24 20:16:56 +01:00
Aymeric Augustin 9b8192ce51 Updated a few doc paragraphs following the app-loading refactor. 2013-12-24 17:20:11 +01:00
Aymeric Augustin f326720a73 Documented the Apps and AppConfig APIs. 2013-12-24 17:20:11 +01:00
Claude Paroz 9267fb88ef Added more spatial predicates for prepared geometries
GEOS 3.3 added crosses, disjoint, overlaps, touches and within
predicates on prepared geometries.
2013-12-24 16:53:09 +01:00
Claude Paroz d17404aa90 Dropped support for GEOS < 3.1 2013-12-24 15:57:13 +01:00
Tim Graham 23d9f517dc Fixed #21585 -- Updated some links to 3rd party database projects.
Thanks graeme.perrow at sap.com for the original report.
2013-12-18 18:48:21 -05:00
Bouke Haarsma a39d672ec7 Fixed #21386 -- Removed admindocs dependence on sites framework
* Removed ADMIN_FOR setting and warn warning
* Group view functions by namespace instead of site
* Added a test verifying namespaces are listed

Thanks to Claude Paroz for reviewing and ideas for improvement.
2013-12-18 19:44:04 +01:00
Kevin Christopher Henry d34c8c338a Fixed #21632 -- Docs: Removed example with callable as query parameter
Using callables as query parameters is undocumented and not working,
so this changes an example from the ForeignKey.limit_choices_to
documentation that uses it.
2013-12-18 12:37:11 -05:00
Denis Moskalets d4e578d0f6 Fixed #21552 -- Allowed the use of None for the iexact lookup.
Thanks Anubhav Joshi for the documentation.
2013-12-18 09:34:53 -05:00
Loic Bistuer 3ce9829b61 Fixed #17413 -- Serialization of form errors along with all metadata. 2013-12-16 16:33:28 -05:00
Baptiste Mispelon 1689744aee Added some internal links to render_to_string documentation. 2013-12-15 23:02:20 +01:00
Andrew Godwin dfc95d240d Fix docs typo 2013-12-15 12:11:02 +00:00
Baptiste Mispelon d4d0dd7416 Changed documentation of HttpResponse.content to indicate it's a bytestring 2013-12-13 11:42:14 +01:00
Rémy HUBSCHER 24fcca6bdd Fixed #21591 -- Added documentation about contrib.messages.get_messages.
Refs https://code.djangoproject.com/ticket/21591
Thanks to track user merb for the report.
2013-12-12 14:56:34 +01:00
Claude Paroz 626bdf648a Updated a bunch of hyperlinks in documentation 2013-12-08 18:40:09 +01:00
Ramiro Morales f876552f4b (Re-)added GeoDjango instructions for building pysqlite2 correctly.
This is a partial undo of 1b142ef5dd.
2013-12-08 11:14:18 -03:00
Ramiro Morales 12615dab78 Fixed #13476 -- Added support for color in console output under Windows.
Detect and use the services of the ANSICON third-party tool if it's
available.
2013-12-02 23:18:04 -03:00
Tim Graham f3e7ab366c Removed gender-based pronouns per [c0a2daad78]. 2013-11-30 08:37:15 -05:00
Claude Paroz 50a8ab7cd1 Enabled makemessages to support several translation directories
Thanks Rémy Hubscher, Ramiro Morales, Unai Zalakain and
Tim Graham for the reviews.
Also fixes #16084.
2013-11-30 11:00:23 +01:00
Loic Bistuer b72b85af15 Removed Form._errors from the docs in favor of the add_error API. 2013-11-30 01:00:53 +07:00
Loic Bistuer f563c339ca Fixed #20867 -- Added the Form.add_error() method.
Refs #20199 #16986.

Thanks @akaariai, @bmispelon, @mjtamlyn, @timgraham for the reviews.
2013-11-30 01:00:53 +07:00
Vajrasky Kok 7e2d61a972 Fixed #21380 -- Added a way to set different permission for static directories.
Previously when collecting static files, the directories would receive permissions
from the global umask. Now the default permission comes from FILE_UPLOAD_DIRECTORY_PERMISSIONS
and there's an option to specify the permissions by subclassing any of the
static files storage classes and setting the directory_permissions_mode parameter.
2013-11-29 08:01:30 -05:00
Baptiste Mispelon 077af42139 Fixed #21515 -- Corrected example of template.Context in documentation.
Thanks to trac user oubiga for the report.
2013-11-28 00:57:13 +01:00
Tim Graham df6760f12c Added a warning regarding risks in serving user uploaded media.
Thanks Preston Holmes for the draft text.
2013-11-27 16:35:25 -05:00
Loic Bistuer f450bc9f44 Added a bulk option to RelatedManager remove() and clear() methods
Refs #21169
2013-11-27 19:45:22 +02:00
Loic Bistuer 17c3997f68 Fixed #21169 -- Reworked RelatedManager methods use default filtering
The `remove()` and `clear()` methods of the related managers created by
`ForeignKey`, `GenericForeignKey`, and `ManyToManyField` suffered from a
number of issues. Some operations ran multiple data modifying queries without
wrapping them in a transaction, and some operations didn't respect default
filtering when it was present (i.e. when the default manager on the related
model implemented a custom `get_queryset()`).

Fixing the issues introduced some backward incompatible changes:

- The implementation of `remove()` for `ForeignKey` related managers changed
  from a series of `Model.save()` calls to a single `QuerySet.update()` call.
  The change means that `pre_save` and `post_save` signals aren't called anymore.

- The `remove()` and `clear()` methods for `GenericForeignKey` related
  managers now perform bulk delete so `Model.delete()` isn't called anymore.

- The `remove()` and `clear()` methods for `ManyToManyField` related
  managers perform nested queries when filtering is involved, which may
  or may not be an issue depending on the database and the data itself.

Refs. #3871, #21174.

Thanks Anssi Kääriäinen and Tim Graham for the reviews.
2013-11-27 19:44:18 +02:00
Alex Gaynor bb5ab908cc Fixed a typo in the documentation 2013-11-26 13:49:54 -06:00
Jay Leadbetter c74504c2dd Fixed #20522 - Allowed use of partially validated object in ModelAdmin.add_view formset validation.
Updated ModelAdmin to use form.instance when passing parent model to
child inlines for add_view. There is effectively no change in the
change_view since the previously passed 'obj' is the same as form.instance.

Thanks to meshy for report, and EvilDMP and timo for review.
2013-11-25 20:01:16 -05:00
Ludwik Trammer 70e61310d6 Fixed #21507 -- Corrected default widget information for FileField 2013-11-25 08:26:10 -05:00
Simon Charette eb38257e51 Fixed #21391 -- Allow model signals to lazily reference their senders. 2013-11-24 17:51:22 -05:00
Tim Graham 03bc0a8ac5 Fixed typo in previous commit; refs #21490. 2013-11-24 16:28:29 -05:00
Tim Graham bfe7377adb Fixed #21490 -- Fixed custom admin URL reverse example.
Thanks glarrain for the report.
2013-11-24 15:19:05 -05:00
Loic Bistuer 2a0ae9b9ec Removed confusing comments from the docs.
The settings reference documentation doesn't seem the right place to
invite users to write their own db and cache backends.

Also the actual wording makes the task sound trivial, which is hardly
the case; writing a custom db backend is a very difficult task, and
writing a custom cache backend is full of gotcha.
2013-11-24 20:22:22 +01:00
Thomas Orozco 957d22b850 Add missing commas in Prefetch docs 2013-11-23 23:48:34 +01:00
Ramiro Morales 62b393c5ae Fixed #21488 -- Multiple locales treatment in i18n commands.
Removed multiple locales separated by commas variation (that wasn't
working as documented) in favor of simply allowing use of the
``--locale``/``-l`` options more than once for ``makemessages`` and
``compilemessages``.

Thanks Romain Beylerian for the report and Claude, Simon for their help.

8750296918 from stable/1.6.x.
2013-11-23 11:53:47 -03:00
Loic Bistuer 82a58ce5b6 Fixed #21491 -- Removed documented workaround for a known issue.
The issue was that two M2M hidden reverse managers
(related_name ending with a '+') could clash with each other.

Refs #21375 and #15932. Thanks Baptiste.
2013-11-23 01:29:09 +07:00
Loic Bistuer 27f04e79b1 Fixed #21479 -- Favor 'migrate' over 'syncdb' in the docs. 2013-11-21 15:12:39 +01:00
Markus Amalthea Magnuson b6a6cf4ab7 Fixed #21427 -- Clearly state integer field value ranges in docs
Added an explicit mention of the exact value ranges for integer type
fields that are safe in all databases supported by Django. Also, put
all value numbers inside double ticks.
2013-11-21 14:15:23 +01:00
Julia Antokhine 3c3be2e8ec fixed typo in builtins.txt 2013-11-19 12:53:28 -05:00
Rocky Meza 42197e31aa Fixed the base class note in the Date Views docs. 2013-11-19 10:23:59 -05:00
Baptiste Mispelon bc0413cbc6 Added more internal links in the management command documentation. 2013-11-18 19:25:28 +01:00
Claude Paroz a0f3eeccf3 Fixed #21397 -- Re-added flexibility to TypedChoiceField coercion
Thanks Elec for the report and Simon Charette for the review.
2013-11-18 18:24:56 +01:00
DanSears 8ca3963ab2 Clarified MySQL Connector note. 2013-11-15 08:51:17 -05:00
Baptiste Mispelon 0048ed77c7 Fixed typos in previous commit (9aa6d4bdb6). 2013-11-12 20:42:44 +01:00
Baptiste Mispelon 9aa6d4bdb6 Removed a mention of `Form._errors` from the documentation.
Also removed a sentence that was incorrect: raising a
`ValidationError` inside `Form.clean` doesn't clear the
`cleaned_data` attribute.

Thanks to loic84 and timograham for the review.
2013-11-12 20:27:21 +01:00
Sjoerd Langkemper d87127655f Fixed #21421 -- Added level_tag attribute on messages.
Exposing the level name (e.g. "info") makes it possible to prepend
something to the class name. For example, Twitter Bootstrap has
an alert-info class. This class can now be added to the message
using `class="alert-{{ message.level_tag }}".
Because the level_tag was on the end of the `tags` property, it
could not be used in this fashion when extra_tags were given.
2013-11-11 17:58:02 +01:00
DanSears a17fc36231 added description of MySQL Connector/Python
Reorganized the MySQLdb section into a "MySQL DB API Drivers" section that describes both MySQLdb and MySQL Connector/Python. Included description of the Django adaptors for these DB API drivers.
2013-11-10 23:46:54 -08:00
Bernardo Pires 8bc350b385 Fixed #21372 -- Corrected docs regarding translating LANGUAGES.
Corrected LANGUAGES documentation on how to translate language
names. Now using django.utils.translation.ugettext_lazy instead
of a dummy gettext() function.

Thanks to Salvatore for the report.
2013-11-09 23:56:53 +01:00
Tim Graham 98de90d3d8 Fixed spelling of compatibility. 2013-11-09 10:17:17 -05:00
Baptiste Mispelon c82e850eed Fixed versionadded misuse in the admin documentation. 2013-11-09 15:08:57 +01:00
glts 413307fe35 Added missing parameter in npgettext_lazy docs 2013-11-08 23:20:50 +01:00
Baptiste Mispelon f2e0266be7 Fixed #21396: Document backwards-incompatible change in RedirectView.get_redirect_url.
Thanks to Tim for the review.
2013-11-08 10:47:36 +01:00
Loic Bistuer f51c1f5900 Fixed #17001 -- Custom querysets for prefetch_related.
This patch introduces the Prefetch object which allows customizing prefetch
operations.

This enables things like filtering prefetched relations, calling select_related
from a prefetched relation, or prefetching the same relation multiple times
with different querysets.

When a Prefetch instance specifies a to_attr argument, the result is stored
in a list rather than a QuerySet. This has the fortunate consequence of being
significantly faster. The preformance improvement is due to the fact that we
save the costly creation of a QuerySet instance.

Thanks @akaariai for the original patch and @bmispelon and @timgraham
for the reviews.
2013-11-07 14:49:49 +02:00
Baptiste Mispelon 366bdc4566 Fixed typos in documentation. 2013-11-06 10:47:07 +01:00
Baptiste Mispelon 3c4832214f Fixed another typo introduced by b914991b37.
Thanks Claude for catching it.
2013-11-06 10:22:29 +01:00
Simon Charette 87908b4fc2 Fixed a documentation typo introduced by b914991b37. 2013-11-05 19:38:46 -05:00
Baptiste Mispelon b914991b37 Added more tests and documentation for dictsort.
It's possible to use something like {{ foo|dictsort:'bar.baz' }}
but this wasn't tested or documented.
2013-11-06 00:26:58 +01:00
Bouke Haarsma 9367b9e828 Django should be capitalized in text 2013-11-02 20:15:40 +01:00
Aymeric Augustin 8b3d9d96ed Merge pull request #1799 from Bouke/tickets/9523
Fixed #9523 -- Restart runserver after translation MO files change
2013-11-02 06:57:50 -07:00
Bouke Haarsma 073b974e66 Fixed #21354 -- Documented contrib.redirects defaults to 301 redirects
Thanks glarrain for the suggestion.
2013-11-02 09:52:28 -04:00
Bouke Haarsma c3936c0d79 Fixed #9523 -- Restart runserver after translation MO files change
Thanks to Krzysztof Kulewski for the initial patch.
2013-11-02 10:29:07 +01:00
Tim Graham 090315f5df Fixed spelling ("dependant" -> "dependent")
Dependent means reliant on.
A dependant is a person like a child or spouse.

Thanks Andrew Wilcox for the report.
2013-11-01 21:29:39 -04:00
Claude Paroz 89116cf24a Fixed #21364 -- Specified InnoDB full-text support from MySQL 5.6.4 on
Thanks thevlad at gmail.com for the report.
2013-11-01 10:59:16 +01:00
Claude Paroz 67c6c1a7cb Fixed #21359 -- Corrected MySQL collation name in databases docs
Thanks k_sze for the report.
2013-11-01 10:46:03 +01:00
Unai Zalakain 15f82c7011 Fixed #9722 - used pyinotify as change detection system when available
Used pyinotify (when available) to replace the "pool-every-one-second"
mechanism in `django.utils.autoreload`.

Thanks Chris Lamb and Pascal Hartig for work on the patch.
2013-10-30 11:45:43 -04:00
Tim Graham eafe279120 Fixed #21306 -- Documented lower-casing behavior of title filter. 2013-10-30 09:33:28 -04:00
Baptiste Mispelon 9fde42a69a Fixed #20610: Added a message level dict to contrib.message context processor. 2013-10-30 13:54:07 +01:00
Tim Graham 1edef50880 Fixed #21316 -- Documented that modifying safe strings makes them unsafe.
Thanks dev@simon.net.nz for the suggestion and vijay_shanker for the patch.
2013-10-30 08:11:31 -04:00
Unai Zalakain fd219fa24c Fixed #8261 -- ModelAdmin hook for customising the "show on site" button
``ModelAdmin.view_on_site`` defines wether to show a link to the object on the
admin detail page. If ``True``, cleverness (i.e. ``Model.get_absolute_url``) is
used to get the url. If it's a callable, the callable is called with the object
as the only parameter. If ``False``, not link is displayed.

With the aim of maitaining backwards compatibility, ``True`` is the default.
2013-10-29 17:10:12 -04:00
Alex Gaynor 6b560b50b9 Mark this as a python code-block 2013-10-29 07:26:06 -07:00
Tim Graham ffcfb4cdcc Fixed #21344 -- Typo in docs/ref/models/queries.txt 2013-10-28 14:52:26 -04:00
Vajrasky Kok 9eecb91695 Fixed #21219 -- Added a way to set different permission for static files.
Previously, when collecting static files, the files would receive permission
from FILE_UPLOAD_PERMISSIONS. Now, there's an option to give different
permission from uploaded files permission by subclassing any of the static
files storage classes and setting the file_permissions_mode parameter.

Thanks dblack at atlassian.com for the suggestion.
2013-10-24 17:40:01 -04:00
Claude Paroz c052699be3 Fixed #20338 -- Stripped ending dot during host validation
Thanks manfre for the report and Timo Graham for the review.
2013-10-24 21:24:04 +02:00
Shai Berger 317040a73b Fixed #13245: Explained Oracle's behavior w.r.t db_table
and how to prevent table-name truncation

Thanks russellm & timo for discussion, and timo for review.
2013-10-23 14:51:22 +03:00
Florian Hahn 5240b83462 Fixed #17027 -- Added support for the power operator in F expressions.
Thanks dan at dlo.me for the initial patch.

- Added __pow__ and __rpow__ to ExpressionNode
- Added oracle and mysql specific power expressions
- Added used-defined power function for sqlite
2013-10-22 10:29:57 -04:00
Riccardo Magliocchetti 1e39982b6e Fixed #21296 -- Added docs for PostgreSQL and unix domains sockets. 2013-10-21 13:02:21 -04:00
Juergen Schackmann f8632572ad Fixed #21212 -- Documented the reverse name for OneToOneField.
Thanks bjb at credil.org for the report.
2013-10-18 16:19:05 -04:00
Bouke Haarsma 2fb5a51fa3 Fixed #18659 -- Deprecated request.REQUEST and MergeDict
Thanks Aymeric Augustin for the suggestion.
2013-10-17 09:42:28 -04:00
Marc Tamlyn 349c12d3f5 Fixed #16855 -- select_related() chains as expected.
select_related('foo').select_related('bar') is now equivalent to
select_related('foo', 'bar').

Also reworded docs to recommend select_related(*fields) over select_related()
2013-10-15 15:59:36 +01:00
Unai Zalakain c7634cd7fe Fixed #7603 -- Added a 'scheme' property to the HttpRequest object
`HttpRequest.scheme` is `https` if `settings.SECURE_PROXY_SSL_HEADER` is
appropriately set and falls back to `HttpRequest._get_scheme()` (a hook
for subclasses to implement) otherwise.

`WSGIRequest._get_scheme()` makes use of the `wsgi.url_scheme` WSGI
environ variable to determine the request scheme.

`HttpRequest.is_secure()` simply checks if `HttpRequest.scheme` is
`https`.

This provides a way to check the current scheme in templates, for example.
It also allows us to deal with other schemes.

Thanks nslater for the suggestion.
2013-10-15 09:04:12 -04:00
Loic Bistuer b16dd1fe01 Fixed #8620 -- Updated the Form metaclass to support excluding fields by shadowing them. 2013-10-14 22:42:33 +07:00
Bouke Haarsma 9b7d38ed5a Fixed #21210 -- Documented when runserver doesn't auto-restart.
Thanks gergely at polonkai.eu for the suggestion.
2013-10-14 10:36:18 -04:00
Claude Paroz 1e8eadc94e Fixed #15888 -- Made tablename argument of createcachetable optional
Thanks Aymeric Augustin for the report and the documentation and
Tim Graham for the review.
2013-10-14 13:24:40 +02:00
Ramiro Morales 18ea1c473b Forms docs: More emphasis in 'id' value customizability. 2013-10-12 13:29:11 -03:00
Tai Lee e527c0b6d8 Fixed #13252 -- Added ability to serialize with natural primary keys.
Added ``--natural-foreign`` and ``--natural-primary`` options and
deprecated the ``--natural`` option to the ``dumpdata`` management
command.

Added ``use_natural_foreign_keys`` and ``use_natural_primary_keys``
arguments and deprecated the ``use_natural_keys`` argument to
``django.core.serializers.Serializer.serialize()``.

Thanks SmileyChris for the suggestion.
2013-10-11 12:52:57 -04:00
Tim Graham 945e033a69 Fixed #8918 -- Made FileField.upload_to optional.
Thanks leahculver for the suggestion and dc and vajrasky for work
on the patch.
2013-10-11 08:07:25 -04:00
Tim Graham 1dae4ac177 Whitespace cleanup.
* Removed trailing whitespace.
* Added newline to EOF if missing.
* Removed blank lines at EOF.
* Removed some stray tabs.
2013-10-10 16:49:20 -04:00
Unai Zalakain 3895d8899d Fixed #21213 -- Added docs for Django's mailing lists.
Added docs/internals/mailing-lists.txt documenting the use of django's
mailing lists. All references across docs changed to point to this page.

The referencing makes use of substitution because there's no way to make
a :ref: link in a non-inline fashion in Sphinx. It also makes use of
rst_epilog Sphinx conf for making this substitutions across all the
docs.
2013-10-04 10:00:36 -04:00
Ryan Kaskel 8b0014869f Fixed #19321 -- Allowed redirect middleware HTTP responses to be overridden.
Thanks Melevir for the suggestion.
2013-10-04 07:36:39 -04:00
Emil Stenström 7a97df190c Fixed #19277 -- Added LocaleMiddleware.response_redirect_class
Thanks ppetrid at yawd.eu for the suggestion.
2013-10-03 16:15:29 -04:00
Tim Graham 75bb6ba966 Fixed #10913 -- Documented how related_name affects QuerySet filtering
Thanks neithere for the suggestion.
2013-10-02 12:12:53 -04:00
Baptiste Mispelon e1b7723817 Changed the doc to use gender-neutral pronouns when possible. 2013-10-02 16:41:04 +02:00
Ramiro Morales 1d0fc61b1c Fixed #15185 -- Allowed ModelAdmin.list_display_links=None to disable change list links.
Thanks rm_ for the suggestion.
2013-10-01 14:25:54 -04:00
Curtis Maloney c39c9f2ad8 Fixed #21154 -- Updated TemplateResponse docs to better explain context.
Thanks mrmachine for the report.
2013-09-30 10:19:56 -04:00
Ramiro Morales 5866a49369 Note about static files dirs paths on Windows.
Added it to the settings reference. We used to have it in comment form
in our old, bigger default project template settings.py file.
2013-09-28 20:32:55 -03:00
Erik Romijn 1a63092981 Fixed #20439 -- Started deprecation of IPAddressField 2013-09-28 10:55:32 +02:00
Carl Meyer 8a4f5de4b6 Fixed malformed directive in CBV date-based-mixins docs. 2013-09-27 11:58:41 -06:00
Brett Koonce 946a2226ea Removed extra p (topppings->toppings) 2013-09-23 19:24:40 -04:00
Louis Fill e15f7f31d0 Fixed #21070 -- Added a more complex database configuration example.
Thanks joejasinski for the suggestion.
2013-09-23 12:18:00 -04:00
Ben Huckvale 98e0453f00 Fixed #21120 -- Added more explicit text on using validators and link to writing validators.
Thanks nicolas at niconomicon.net for the suggestion.
2013-09-23 10:37:41 -04:00
Ramiro Morales bebb449ac3 Added docs for changes in commit dd3a883894.
Refs #20693.
2013-09-22 15:43:27 -03:00
Ramiro Morales ce0c5c38ea A few doc additions for changes from d228c1192e. 2013-09-22 13:46:16 -03:00
mlissner d8f2d940cc Correct very minor typo
Just changed as to has.
2013-09-21 13:34:45 -07:00
Curtis Maloney 43a2ec7999 Fixed #21133 --Clarifed documentation about strftime formatting. 2013-09-21 06:42:11 -04:00
evildmp dc8f95b639 Fixed #20877 -- added a performance optimization guide 2013-09-20 23:21:49 +01:00
tschilling 0d1ba84d13 Fixed #20702 -- Deprecated get_formsets in favor of get_formsets_with_inlines.
Thanks stanislas.guerra at gmail.com for the report.
2013-09-20 07:47:24 -04:00
yokomizor df27803a55 Fixed #9532 -- Added min_num and validate_min on formsets.
Thanks gsf for the suggestion.
2013-09-19 13:11:49 -04:00
Brian Holdefehr 98514849dc Fixed #19414 -- Added admin registration decorator
Thanks stavros for the suggestion.
2013-09-18 11:44:10 -04:00
Tim Graham d1c9802811 Fixed #21116 -- Made usage of manage.py in docs more consistent.
Thanks daniel.quattro at gmail.com for the report.
2013-09-18 10:35:41 -04:00
Berker Peksag 2f0566fa61 Fixed #4278 -- Added a dirs parameter to a few functions to override TEMPLATE_DIRS.
* django.template.loader.get_template()
* django.template.loader.select_template()
* django.shortcuts.render()
* django.shortcuts.render_to_response()

Thanks amcnabb for the suggestion.
2013-09-18 07:37:08 -04:00
Tim Graham 18ffdb1772 Fixed #17627 -- Renamed util.py files to utils.py
Thanks PaulM for the suggestion and Luke Granger-Brown and
Wiktor Kołodziej for the initial patch.
2013-09-16 12:52:05 -04:00
Goetz 39b49fd339 Fixed #21101 -- Updated urlize documentation to mention email addresses 2013-09-13 12:42:06 -04:00
Matt Austin 9451d8d558 Fixed #21095 -- Documented new requirement for dates lookups.
Day, month, and week_day lookups now require time zone definitions in the database.
2013-09-13 09:56:19 +02:00
Ramiro Morales 8b366a50f4 Fixed a couple of typos in GeoDjango docs. 2013-09-12 19:36:45 -03:00
Phaneendra Chiruvella bd72c2acb6 Minor typo fix in django.contrib.auth.models.User docs 2013-09-12 03:15:00 +05:30
Tim Graham da843e7dba Fixed #20887 -- Added a warning to GzipMiddleware in light of BREACH.
Thanks EvilDMP for the report and Russell Keith-Magee
for the draft text.
2013-09-11 08:17:15 -04:00
oz123 fca4c4826e Fixed #21075 - Improved doc for calling call_command with arguments. 2013-09-10 09:17:47 -04:00
Aymeric Augustin ec2778b445 Fixed #17262 -- Refactored tzinfo implementations.
This commit deprecates django.utils.tzinfo in favor of the more recent
django.utils.timezone which was introduced when Django gained support
for time zones.
2013-09-09 22:32:51 +02:00
Kevin Christopher Henry 9d700322b3 Fixed #19885 -- cleaned up the django.test namespace
* override_settings may now be imported from django.test
* removed Approximate from django.test
* updated documentation for things importable from django.test

Thanks akaariai for the suggestion.
2013-09-09 16:03:13 -04:00
Tim Graham fb51c9a0f2 Fixed spelling; refs #16895.
Thanks Panagiotis Issaris for the report.
2013-09-09 11:30:31 -04:00
e0ne cbf08c6b0c Fixed #16895 -- Warned about cost of QuerySet ordering
Thanks outofculture at gmail.com for the suggestion.
2013-09-09 09:47:18 -04:00
Aymeric Augustin e192739b3e Fixed #20409 -- Clarified how unique_for_date works when USE_TZ is set. 2013-09-07 14:08:54 -05:00
Tim Graham a86ecc80a2 Fixed #20005 -- Documented that Oracle databases need execute permission on SYS.DBMS_LOB.
Thanks jafula for the suggestion.
2013-09-07 13:59:57 -04:00
Tim Graham ff49449425 Merge pull request #1592 from pablomouzo/fix-admin-view-response-methods-docs
Improved docs for `contrib.admin.options.ModelAdmin.response_*`
2013-09-07 09:38:48 -07:00
Pablo Mouzo 2223b83a55 Improved docs for `contrib.admin.options.ModelAdmin.response_*`
Added links to code references in the docs for `response_add`,
`response_change` and `response_delete`.
2013-09-07 11:33:10 -05:00
Keith Edmiston c54fa1a7bc Fixed 16992 -- Added InnoDB warning regarding reuse of AUTO_INCREMENT values.
Thanks kent at nsc.liu.se for the report.
2013-09-07 12:13:45 -04:00
Pablo Mouzo 9079436b00 Add docs for `response_add`, `response_change` and `response_delete` 2013-09-07 11:01:35 -05:00
Keith Edmiston 028db97503 Fixed #19295 -- Documented that CachedStaticFilesStorage isn't compatible with runserver --insecure. 2013-09-06 17:26:15 -04:00
Andrew Godwin efd1e6096e Adding 'sqlmigrate' command and quote_parameter to support it. 2013-09-06 15:28:12 -05:00
Tim Graham 5ca290f5db Fixed some sphinx errors and added some links. 2013-09-06 16:15:35 -04:00
Adrian Holovaty d179fc72cf Fixed versionadded and ordering of note in admin/index.txt 2013-09-06 14:23:29 -05:00
Tim Graham 38d2e7c225 Merge pull request #1567 from technivore/ticket_20970
re-indented method documentation within RelatedManager
2013-09-06 12:07:25 -07:00
Matthew Rich af67b93c02 re-indented method documentation within RelatedManager 2013-09-06 13:44:40 -05:00
Daniele Procida 263eecc583 Merge pull request #1544 from evildmp/ticket_20920_rebase
Fixed #20920 -- Consolidated F() and Q() documentation
2013-09-06 11:27:58 -07:00
evildmp 79cc66692a Consolidated documentation for F() and Q() 2013-09-06 12:57:25 -05:00
Adrian Holovaty a962286b74 Added AdminSite attributes for easily changing admin title.
AdminSite now has overridable site_header, site_title and index_title attributes. Changed
each admin view to pass these to the context (in a new AdminSite.each_context() method).
The intent here is to make it easier to override these things in the common case, instead of
having to override a template, which is a bigger burden.
2013-09-06 12:31:50 -05:00
Matthew Rich a5bcc09c8f documented RelatedManager calling save() behind the scenes, added section on direct replacement of related object set 2013-09-06 11:37:08 -05:00
Preston Timmons 8625c7aab3 Fixed #16096 -- Added origin attribute to template instances.
Thanks jdunck for the suggestion.
2013-09-06 09:14:52 -04:00
Eric Boersma 4d13cc56de Fixed #21035 -- Changed docs to treat the acronym SQL phonetically.
The documentation and comments now all use 'an' to
refer to the word SQL and not 'a'.
2013-09-05 20:14:58 -04:00
Tim Graham eacf060e01 Fixed #21044 -- Documented django.core.urlresolvers.Resolver404
Thanks Keryn Knight for the suggestion.
2013-09-05 08:45:33 -04:00
Tim Graham ebfe42d018 Fixed #21009 -- Added a versionchanged note regarding changes to clean().
refs [fb1dd6b13a] and [1c4a9bd9ad]
2013-09-05 05:47:45 -04:00
Tim Graham 533d1ab334 Fixed #20958 -- Documented that GenericForeignKey fields can't be accessed in forms.
Thanks marky1991.
2013-09-04 13:18:08 -04:00
Paul C. Anagnostopoulos 1ccdc08189 Clarified docs for some tags and filters 2013-09-04 12:32:05 -04:00