File size: 531 Bytes
b4f2238
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""Module for forms."""

from __future__ import annotations

from typing import Any

from django import forms

from apps.documents.models import EvidenceList


class EvidenceListForm(forms.ModelForm[EvidenceList]):
    class Meta:
        model = EvidenceList
        fields: str = "__all__"

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)

        if "list_type" in self.fields:
            self.fields["list_type"].disabled = True


__all__: list[str] = ["EvidenceListForm"]