feat: переменная «Структура ИС» (structure) в цикле information_systems
- models.py: поле structure у InformationSystem
- variables.py: {{item.structure}} / {{structure}} в цикле,
{{is_structure_N}} в индексированных
- ui.py: поле «Структура ИС» на вкладке ИС
This commit is contained in:
@@ -36,6 +36,7 @@ class InformationSystem:
|
||||
personal_data_category: List[str] = field(default_factory=list)
|
||||
purpose: str = ""
|
||||
room: str = ""
|
||||
structure: str = "" # Структура информационной системы
|
||||
|
||||
|
||||
@dataclass
|
||||
|
||||
@@ -333,6 +333,11 @@ class DokoGenApp:
|
||||
self.is_pd_count_combo.grid(row=6, column=1, padx=10, sticky=tk.W)
|
||||
self.is_pd_count_combo.bind('<<ComboboxSelected>>', lambda e: self._on_categories_or_count_changed())
|
||||
|
||||
# Структура ИС
|
||||
ttk.Label(fields_frame, text="Структура ИС:").grid(row=7, column=0, sticky=tk.W, pady=2)
|
||||
self.is_structure_entry = ttk.Entry(fields_frame, width=55)
|
||||
self.is_structure_entry.grid(row=7, column=1, padx=10, sticky=tk.EW)
|
||||
|
||||
|
||||
|
||||
fields_frame.columnconfigure(1, weight=1)
|
||||
@@ -608,6 +613,8 @@ class DokoGenApp:
|
||||
isys = self.model.information_systems[self._current_is_idx]
|
||||
isys.name = self.is_name_entry.get().strip()
|
||||
isys.description = self.is_description_entry.get().strip()
|
||||
if hasattr(self, 'is_structure_entry'):
|
||||
isys.structure = self.is_structure_entry.get().strip()
|
||||
isys.is_local_network = self.is_lan_var.get()
|
||||
isys.is_internet = self.is_internet_var.get()
|
||||
isys.threat_type = self.is_threat_var.get()
|
||||
@@ -867,6 +874,9 @@ class DokoGenApp:
|
||||
self.is_name_entry.insert(0, isys.name or "")
|
||||
self.is_description_entry.delete(0, tk.END)
|
||||
self.is_description_entry.insert(0, isys.description or "")
|
||||
if hasattr(self, 'is_structure_entry'):
|
||||
self.is_structure_entry.delete(0, tk.END)
|
||||
self.is_structure_entry.insert(0, isys.structure or "")
|
||||
self.is_lan_var.set(isys.is_local_network)
|
||||
self.is_internet_var.set(isys.is_internet)
|
||||
self.is_threat_var.set(isys.threat_type or "3")
|
||||
|
||||
@@ -219,6 +219,7 @@ def _add_is_indexed_vars(replacements: Dict[str, str], isys, idx: int):
|
||||
'is_users': ', '.join(isys.users_list or []) or '—',
|
||||
'is_pd_count': str(isys.pd_count or '—'),
|
||||
'is_purpose': isys.purpose or '—',
|
||||
'is_structure': getattr(isys, 'structure', '') or '—',
|
||||
}
|
||||
for f, v in fields.items():
|
||||
replacements[f'{{{{{f}_{idx}}}}}'] = str(v)
|
||||
@@ -267,6 +268,7 @@ def _build_loop_data(company: Company, is_list: List) -> Dict[str, List[Dict]]:
|
||||
'processing_modes': isys.processing_modes or '—',
|
||||
'pd_subjects': '; '.join(isys.pd_subjects_list or []) or '—',
|
||||
'is_purpose': isys.purpose or '—',
|
||||
'structure': getattr(isys, 'structure', '') or '—',
|
||||
})
|
||||
loops['information_systems'] = items
|
||||
|
||||
|
||||
Reference in New Issue
Block a user