Introduce BaseModel to hold universal overrides for Django's models.Model #11747

Closed
opened 2025-12-29 21:49:24 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Oct 17, 2025).

Originally assigned to: @jeremystretch on GitHub.

Proposed Changes

  1. Introduce a new abstract model named BaseModel.
  2. Move the default manager definition to BaseModel.
  3. Move the clean() method from NetBoxModel to BaseModel.
  4. Update NetBoxModel & ChangeLoggedModel to inherit from BaseModel instead of models.Model.
  5. Update OrganizationalModel to inherit from NetBoxModel.

Justification

This approach does a better job of organizing stock functionality, and provides a convenient hook for (mostly) global model overrides. It will also allow for a slightly cleaner implementation of #20304.

Originally created by @jeremystretch on GitHub (Oct 17, 2025). Originally assigned to: @jeremystretch on GitHub. ### Proposed Changes 1. Introduce a new abstract model named BaseModel. 2. Move the default manager definition to BaseModel. 3. Move the `clean()` method from NetBoxModel to BaseModel. 4. Update NetBoxModel & ChangeLoggedModel to inherit from BaseModel instead of `models.Model`. 5. Update OrganizationalModel to inherit from NetBoxModel. ### Justification This approach does a better job of organizing stock functionality, and provides a convenient hook for (mostly) global model overrides. It will also allow for a slightly cleaner implementation of #20304.
adam added the status: acceptedtype: housekeeping labels 2025-12-29 21:49:24 +01:00
adam closed this issue 2025-12-29 21:49:24 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11747