Skip to content

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

@MaayanPeleg

Description

@MaayanPeleg

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    app: pynetboxstatus: needs ownerThis issue is tentatively accepted pending a volunteer committed to its implementationtype: bugA confirmed report of unexpected behavior in the application

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions