Skip to content

Store custom field default values as JSON #5400

@jeremystretch

Description

@jeremystretch

Environment

  • Python version: 3.6.9
  • NetBox version: 2.10-beta1

Proposed Functionality

The CustomField model's default field should be a JSONField rather than a CharField.

Use Case

Using a JSONField permits the storage of a default value in its native type, and avoids the need for clunky deserialization (e.g. storing the string "false" for a boolean field).

Database Changes

Migrate the default field to a JSONField and update all existing values accordingly.

External Dependencies

None

Metadata

Metadata

Assignees

Labels

betaConcerns a bug/feature in a beta releasestatus: acceptedThis issue has been accepted for implementationtype: housekeepingChanges to the application which do not directly impact the end user

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions