mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +00:00
Fixed #373 -- Added CompositePrimaryKey.
Thanks Lily Foote and Simon Charette for reviews and mentoring this Google Summer of Code 2024 project. Co-authored-by: Simon Charette <charette.s@gmail.com> Co-authored-by: Lily Foote <code@lilyf.org>
This commit is contained in:
parent
86661f2449
commit
978aae4334
43 changed files with 3078 additions and 29 deletions
|
@ -707,6 +707,23 @@ or :class:`~django.forms.NullBooleanSelect` if :attr:`null=True <Field.null>`.
|
|||
The default value of ``BooleanField`` is ``None`` when :attr:`Field.default`
|
||||
isn't defined.
|
||||
|
||||
``CompositePrimaryKey``
|
||||
-----------------------
|
||||
|
||||
.. versionadded:: 5.2
|
||||
|
||||
.. class:: CompositePrimaryKey(*field_names, **options)
|
||||
|
||||
A virtual field used for defining a composite primary key.
|
||||
|
||||
This field must be defined as the model's ``pk`` field. If present, Django will
|
||||
create the underlying model table with a composite primary key.
|
||||
|
||||
The ``*field_names`` argument is a list of positional field names that compose
|
||||
the primary key.
|
||||
|
||||
See :doc:`/topics/composite-primary-key` for more details.
|
||||
|
||||
``CharField``
|
||||
-------------
|
||||
|
||||
|
@ -1615,6 +1632,8 @@ not an instance of ``UUID``.
|
|||
hyphens, because PostgreSQL and MariaDB 10.7+ store them in a hyphenated
|
||||
uuid datatype type.
|
||||
|
||||
.. _relationship-fields:
|
||||
|
||||
Relationship fields
|
||||
===================
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue