The `check` docs target now runs spelling, black, and lint, so all
current documentation quality checks can be run with a single command.
Also documented the lint-docs check's availability and usage.
Lines in the docs files were manually adjusted to conform to the
79 columns limit per line (plus newline), improving readability and
consistency across the content.
This adds a `lint.py` script to run sphinx-lint on Django's docs files,
a mathing `lint` target in the `docs/Makefile` and `docs/make.bat`, and
updates `docs/requirements.txt` accordingly.
Determining if a field is db_returning based on the default connection
feature availability prevents the usage of RETURNING for db_default
fields in setups where non-default backends do support RETURNING.
Whether or not the field should be attempted to be returned is already
checked at the compiler level which is backend aware.
When running the `bulk_create` tests with Postgres settings and
`--reverse`, the following IntegrityError was raised in
bulk_create.tests.BulkCreateTransactionTests.test_objs_with_and_without_pk:
django.db.utils.IntegrityError: duplicate key value violates unique
constraint "bulk_create_country_pkey"
DETAIL: Key (id)=(1) already exists.
This branch fixes this by ensuring the ID is unique since DB sequences
are not resetted between tests.
In alogout(), there is no need to check the is_authenticated attribute
when user is None.
In aget_user(), there is no need to call get_session_auth_hash() twice.
Follow up to 50f89ae850f6b4e35819fe725a08c7e579bfd099.
Since 142ab6846ac09d6d401e26fc8b6b988a583ac0f5
get_contenttypes_and_models() function was only used in this module and
we only needed the model names, not the content type objects themselves.
Asserting an upper bound for the number of executed queries can be achieved by
using CaptureQueriesContext instead of enabling the whole DEBUG machinery.
When dealing with an heterogeneous set of object with regards to primary key
assignment that fits in a single batch there's no need to wrap the single
INSERT statement in a transaction.
Introduced `{% partialdef %}` and `{% partial %}` template tags to
define and render reusable named fragments within a template file.
Partials can also be accessed using the `template_name#partial_name`
syntax via `get_template()`, `render()`, `{% include %}`, and other
template-loading tools.
Adjusted `get_template()` behavior to support partial resolution, with
appropriate error handling for invalid names and edge cases. Introduced
`PartialTemplate` to encapsulate partial rendering behavior.
Includes tests and internal refactors to support partial context
binding, exception reporting, and tag validation.
Co-authored-by: Carlton Gibson <carlton@noumenal.es>
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Co-authored-by: Nick Pope <nick@nickpope.me.uk>