Skip to content

Allow GenericForeignKey Custom Object Type Fields #31

@mrmrcoleman

Description

@mrmrcoleman

Plugin Version

commit 722bbd6 (HEAD -> public-preview, origin/public-preview) Author: btiemann btiemann@netboxlabs.com Date: Thu Jun 26 15:31:01 2025 -0400

Proposed functionality

Multiple Private Preview participants have requested the ability to use GenericForeignKeys for Custom Object Type fields

  • Currently Custom Object Type fields can only point to one type
  • It is common for users to to want to model "polymorphic" type behaviour. e.g. a Custom Object Type "dataflow" with fields of type Multiobject but that could point to either IPAddresses, IPRanges, or Prefixes

Note We should add an index across the fields https://github.com/netbox-community/netbox/blob/develop/docs/development/extending-models.md

Use case

  • User creates a Custom Object Type X
  • User adds a field Y of type Object or MultiObject
  • User can select one or more related types instead of just one

External dependencies

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions