vinogorod: проект СКС «Винный город» — скрипты, документация, снимки справочников NetBox

- скрипты: экспорт справочников (export_netbox_refs) и портовой модели
  (export_netbox_inventory) для составления CSV-импорта устройств/соединений
- docs: CSV-снимки справочников + inventory JSON (2026-10-12, сайт «Винный город»)
- статус/план/конспекты проекта; .gitignore исключает .venv, skc_pdfs, skc_texts
This commit is contained in:
2026-10-12 05:41:30 +00:00
parent 2677c43b4b
commit bbf8b20802
48 changed files with 68003 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
import json
from django.apps import apps
from dcim.models import Cable
out = {}
out['cable_fields'] = [f.name for f in Cable._meta.get_fields()]
out['cables'] = []
for c in Cable.objects.all():
t = c.terminations.all().order_by('id')
out['cables'].append({
'label': c.label, 'type': c.type, 'status': c.status, 'length': str(c.length), 'len_unit': c.length_unit,
'terms': [{'end': x.cable_end, 'type': x.termination_type.split('.')[-1], 'obj': str(x.termination)} for x in t]
})
print(json.dumps(out, ensure_ascii=False, indent=1, default=str))