Use selected object attributes in dependent form fields

Abierto
#29 0 comentarios 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
42/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
frontend, web-dev

Línea de trabajo

Start with NetBox's dynamic-selection fields in netbox/utilities/forms/fields/dynamic.py and the related widgets. Trace how query_params currently resolve $variable references and how dependent fields refresh when selections change or clear. Done means a documented, limited attribute syntax supports permitted API attributes, handles missing data predictably, preserves existing behavior, and respects object permissions.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

app: scripts complexity: high status: backlog type: feature
Plugin Version

v0.0.1

Proposed functionality

Allow dynamic query_params references to use a selected object's attribute, not just its ID. For example, $prefix.prefix could supply a selected Prefix's value to an IP address filter.

Define a limited, documented syntax and preserve existing $variable behavior. Allow only permitted attributes from the object's API representation, not arbitrary expressions or unrestricted model traversal.

Refresh dependent fields when the selection changes or is cleared. Handle missing attributes and unavailable objects predictably, without bypassing object permissions.

Use case

Some filters need a prefix, slug, or another value rather than a database ID. Authors should not need custom JavaScript or ask users to re-enter information already available from their selection.

Related request: netbox-community/netbox#23082.

External dependencies

This may need changes to NetBox's dynamic-selection fields and widgets. No new package or service is expected.

Lenguaje dominante
Python
Estrellas
8
Forks
0
Merge medio
11 h 23 min
PR fusionados (30 d)
24

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de netbox-community/netbox-scripts

Todos los issues de netbox-community/netbox-scripts

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.