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

Update Plugin Inheritance in Docs #362

Merged
merged 1 commit into from
Apr 28, 2021

Conversation

jmcgill298
Copy link
Contributor

Docs suggest to use nautobot.core.models.BaseModel, but then examples do not follow this practice

Copy link
Contributor

@glennmatthews glennmatthews left a comment

Choose a reason for hiding this comment

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

Thank you for the PR! We should actually discuss this a bit, I think - while using BaseModel is definitely acceptable, in many cases plugins may actually be better off to use PrimaryModel or OrganizationalModel to get the extra features (change logging, custom fields, relationships) that those models provide. Maybe we stick with BaseModel for this document for the moment, and plan to create a more in-depth development guide in the future, perhaps as part of #13, #14, and/or #15?

@jmcgill298
Copy link
Contributor Author

jmcgill298 commented Apr 23, 2021

It seems that github is not allowing you to view markdown files as code files (non-rendered view), but these changes were made to make the examples consistent with the surrounding documentation. Line 191 says:

It is highly recommended to have plugin models inherit from at least `nautobot.core.models.BaseModel` which provides base functionality and convenience methods common to all models.

These 2 examples do not follow that recommendation currently.

I have no thoughts as far as what should be demonstrated here, only that it is consistent with what the document prescribes.

As for providing additional docs that provide deeper understanding of the options, I am definitely a fan of the idea.

@jathanism jathanism merged commit a4e961b into nautobot:develop Apr 28, 2021
@jmcgill298 jmcgill298 deleted the plugin_docs branch April 28, 2021 21:52
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

3 participants