Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add device modules #5657

Merged
merged 125 commits into from
Jun 3, 2024
Merged

Add device modules #5657

merged 125 commits into from
Jun 3, 2024

Conversation

gsnider2195
Copy link
Contributor

@gsnider2195 gsnider2195 commented May 1, 2024

Closes #2101

What's Changed

This is the feature branch for the device modules feature

Screenshots

TODO

  • Explanation of Change(s)
  • Added change log fragment(s) (for more information see the documentation)
  • Attached Screenshots, Payload Example
  • Unit, Integration Tests
  • Documentation Updates (when adding/changing features)
  • Example App Updates (when adding/changing features)
  • Outline Remaining Work, Constraints from Design
  • Add name field to ModuleBay and ModuleBayTemplate and remove uniqueness constraint on position field
  • Templating names when instantiating a module component #5730

nautobot/dcim/api/urls.py Outdated Show resolved Hide resolved
nautobot/dcim/factory.py Outdated Show resolved Hide resolved
nautobot/dcim/factory.py Outdated Show resolved Hide resolved
nautobot/dcim/tests/test_api.py Outdated Show resolved Hide resolved
@gsnider2195 gsnider2195 changed the title Add device modules (models and REST API) Add device modules (models and migrations) May 1, 2024


@extras_features("custom_validators")
class ModuleBayTemplate(BaseModel, ChangeLoggedModel, CustomFieldModel, RelationshipModel):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be a subclass of ModularComponentTemplateModel? We would need to make the name field optional

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, could subclass and override name to optional for this specific model, but that might be iffy if there's code assuming that all ComponentTemplateModels have a name?

nautobot/dcim/factory.py Outdated Show resolved Hide resolved
nautobot/dcim/models/device_components.py Outdated Show resolved Hide resolved
nautobot/dcim/models/devices.py Show resolved Hide resolved
nautobot/dcim/models/devices.py Outdated Show resolved Hide resolved
nautobot/dcim/models/devices.py Outdated Show resolved Hide resolved
nautobot/dcim/models/devices.py Outdated Show resolved Hide resolved
nautobot/dcim/migrations/0060_module_models.py Outdated Show resolved Hide resolved


@extras_features("custom_validators")
class ModuleBayTemplate(BaseModel, ChangeLoggedModel, CustomFieldModel, RelationshipModel):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, could subclass and override name to optional for this specific model, but that might be iffy if there's code assuming that all ComponentTemplateModels have a name?

nautobot/dcim/models/device_components.py Show resolved Hide resolved
nautobot/dcim/models/devices.py Outdated Show resolved Hide resolved
nautobot/dcim/models/devices.py Show resolved Hide resolved
nautobot/dcim/tests/test_models.py Outdated Show resolved Hide resolved
gsnider2195 and others added 3 commits May 2, 2024 15:51
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
@gsnider2195 gsnider2195 marked this pull request as ready for review May 2, 2024 21:10
@gsnider2195 gsnider2195 marked this pull request as ready for review June 3, 2024 14:33
@gsnider2195 gsnider2195 merged commit 5c7792b into next Jun 3, 2024
17 checks passed
@gsnider2195 gsnider2195 deleted the u/gas-2101-device-modules branch June 3, 2024 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants