Refs #8620.
If we allow any value to remove form fields then we get name clashes
with method names, media classes etc. There was a backwards
incompatibility introduced meaning ModelForm subclasses with declared
fields called media or clean would lose those fields.
Field removal is now only permitted by using the sentinel value None.
The docs have been slightly reworded to refer to removal of fields
rather than shadowing.
Thanks to gcbirzan for the report and initial patch, and several of the
core team for opinions.
The first part of django.contrib.postgres, including model and two form
fields for arrays of other data types.
This commit is formed of the following work:
Add shell of postgres app and test handling.
First draft of array fields.
Use recursive deconstruction.
Stop creating classes at lookup time.
Add validation and size parameter.
Add contained_by lookup.
Add SimpleArrayField for forms.
Add SplitArrayField (mainly for admin).
Fix prepare_value for SimpleArrayField.
Stop using MultiValueField and MultiWidget.
They don't play nice with flexible sizes.
Add basics of admin integration.
Missing:
- Tests
- Fully working js
Add reference document for django.contrib.postgres.fields.ArrayField.
Various performance and style tweaks.
Fix internal docs link, formalise code snippets.
Remove the admin code for now.
It needs a better way of handing JS widgets in the admin as a whole
before it is easy to write. In particular there are serious issues
involving DateTimePicker when used in an array.
Add a test for nested array fields with different delimiters.
This will be a documented pattern so having a test for it is useful.
Add docs for SimpleArrayField.
Add docs for SplitArrayField.
Remove admin related code for now.
definition -> description
Fix typo.
Py3 errors.
Avoid using regexes where they're not needed.
Allow passing tuples by the programmer.
Add some more tests for multidimensional arrays.
Also fix slicing as much as it can be fixed.
Simplify SplitArrayWidget's data loading.
If we aren't including the variable size one, we don't need to search
like this.
Previously the FORMAT_MODULE_PATH setting only accepted one string (dotted
module path). A feature has been added to also allow a list of strings.
This is useful when using several reusable third party apps that define new
formats. We can now use them all and we can even override some of the formats
by providing a project-wide format module.
Previously the FORMAT_MODULE_PATH setting only accepted one string (dotted
module path).
This is useful when using several reusable third party apps that define new
formats. We can now use them all and we can even override some of the formats
by providing a project-wide format module.
Added DateTimeCheckMixin to avoid the use of default, auto_now, and
auto_now_add options together. Added the fields.E151 Error that is raised
if one or more of these options are used together.
Fields can now receive the `label_suffix` attribute, which will override
a form's `label_suffix`.
This enhances the possibility to customize form's `label_suffix`, allowing
to use such customizations while using shortcuts such as
`{{ form.as_p }}`.
Note that the field's own customization can be overridden at runtime by
using the `label_prefix` parameter to `BoundField.label_tag()`.
Refs #18134.
Avoided introducing a new regex-based SQL splitter in the migrations
framework, before we're bound by backwards compatibility.
Adapted this change to the legacy "initial SQL data" feature, even
though it's already deprecated, in order to facilitate the transition
to migrations.
sqlparse becomes mandatory for RunSQL on some databases (all but
PostgreSQL). There's no API to provide a single statement and tell
Django not to attempt splitting. Since we have a more robust splitting
implementation, that seems like a good tradeoff. It's easier to add a
new keyword argument later if necessary than to remove one.
Many people contributed to both tickets, thank you all, and especially
Claude for the review.
Refs #22401.