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

List of dictionaries as a field causes Record.save() error #625

Open
MaayanPeleg opened this issue Jun 26, 2024 · 0 comments
Open

List of dictionaries as a field causes Record.save() error #625

MaayanPeleg opened this issue Jun 26, 2024 · 0 comments
Labels
type: bug A confirmed report of unexpected behavior in the application

Comments

@MaayanPeleg
Copy link

pynetbox version

v7.3.3

NetBox version

V3.7.8

Python version

3.9

Steps to Reproduce

In a plugin model, create a JSON field that is set to a lost of dictionaries.
For example: [{"example": "bug"}]

Expected Behavior

This field should be handles as a JSON list

Observed Behavior

Pynetbox on initialising the record from netbox, treats the list of dictionaries as references to objects in netbox, so each dictionary is initialised as records, when save is ran, it trys to get it's records id and raises an error as there is no id, as it's not a Record. The bug appears to be caused in _init_cache aswell as in _parse_values() in list_parser()

@MaayanPeleg MaayanPeleg added the type: bug A confirmed report of unexpected behavior in the application label Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

1 participant