How are users assigned to tasks? #38
-
|
How are users assigned to tasks? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
When creating or editing a task through the AddTaskModal, you can select a user from a dropdown that displays both their name and Discord ID. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @cleboo! Both errors are symptoms of the same root cause — Django needs to be fully initialised before any NetBox or plugin code can be imported, and a standalone Error 1 ( Error 2 ( Option A — Use the NetBox shell (easiest)cd /opt/netbox/netbox
python manage.py nbshellThen paste your code inside the shell. All models are importable immediately. To run a file non-interactively: python manage.py nbshell < export_cot.pyOption B — Standalone script with Django bootstrapAdd these lines at the top of your script, before any other imports: import os
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "netbox.settings")
django.setup() # <- this is the missing piece
from netbox_custom_objects.schema.exporter import export_cots
from netbox_custom_objects.models import CustomObjectType
import json
cots = CustomObjectType.objects.filter(slug__in=["typeA", "typeB"])
document = export_cots(cots)
print(json.dumps(document, indent=2))Then run from the directory that contains cd /opt/netbox/netbox
python /path/to/export_cot.pyThe docs did not make this clear — I have just updated them to explain both approaches and add a warning about the |
Beta Was this translation helpful? Give feedback.
When creating or editing a task through the AddTaskModal, you can select a user from a dropdown that displays both their name and Discord ID.