Plugin Development Foreingkey namespace. #9208
Unanswered
renatoalmeidaoliveira
asked this question in
Q&A
Replies: 2 comments 4 replies
-
When defining a ForeignKey, you can specify its
Aside from that, you just need to be careful when importing classes from other apps. (You can often work around conflicts by doing e.g. |
Beta Was this translation helpful? Give feedback.
3 replies
-
There’s another problem and that is the inevitable merge conflicts with migrations.
If you use related_name=‘+’ you avoid that issue.
…Sent from my iPhone
On 25 Apr 2022, at 16:40, Renato Almeida de Oliveira ***@***.***> wrote:
I know, I bring this topic because as the plugin developer community grows, we problably gonna face issues related with names collisions, so it would be great to have some development standarts, like: "Netbox core team reccomends to avoid using related_name, ie using related_name='+', but if your plugin requires related name for side_plugins for example, always prepend your plugin name to the attribute".
That way I think that collisions problems might be reduced.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When developing a plugin it's possible to create Foreingkey to base models, like Device, Tenant....
With the possibility for the community create puglins it's might ocour attribute name collisions, so there're any recommendation about "namespacing" the attributes?
Something like always use your related name prepending your plugin name.
Beta Was this translation helpful? Give feedback.
All reactions