Skip to content

Documentation: Prefer AutoField as PK of broken parts #12

@shaib

Description

@shaib

Current documentation says that when we break a model down into parts, and we need to define the partsPKs explicitly, we can use eitherIntegerFieldorAutoField; it even prefers IntegerField` because these fields should, in principle, not have generated values put into them (they should have values copied from those generated for the main model), and that is a little more explicit.

However, this creates issues with the Django admin -- IntegerFields show up as editable, and even required, in the admin for the main model. Changing them to AutoField makes them go away, and probably sets some other things straight (e.g. marks them as serialized=False).

The documentation needs to be changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentationgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions