-
Notifications
You must be signed in to change notification settings - Fork 171
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 custom model name lookup to fix #389 #390
Add custom model name lookup to fix #389 #390
Conversation
I believe the idea was to pass return_obj to Endpoint class and implement full Permission model not only users field.
and somehow pass Permission model to permissions Endpoint you get the same behaviour as with default defined models. |
I think you just need to find a way to pass your new model to |
Any new comments anyone? @Dimaqa @zachmoody Is it a problem that Lost track of all these classes and models already 😄 but thinking that something needs to be figured out to support modern NetBox versions. Is it then dealing with all kinds of custom models, or fixing the pynetbox/pynetbox/core/response.py Line 316 in 33a7fb9
@Dimaqa feel free to open your own PR if you have a better fix in mind. |
Not sure how @zachmoody gets the notifications for a new commit in an existing PR so here is a ping for you 😁 (see the modified message on top of this PR) |
Fixes #389
The
list_parser()
function inRecord._parse_values()
is modified to support lists of custom models, defined like this:Running example:
The original PR text left here for the memory of all the unsuccessful attempts: 😁
The model name lookup table is populated in the model source file (
users.py
) to prevent circular imports (we cannot importUsers
inresponse.py
becauseusers.py
already importsresponse.py
).Works now: