from django import forms from .models import File, RuleAttribute, AttributeType class FileUploadForm(forms.ModelForm): class Meta: model = File fields = ['name', 'file'] class UploadCertificateForm(forms.Form): certificate = forms.FileField() class RuleAttributeForm(forms.ModelForm): class Meta: model = RuleAttribute fields = ['attribute_type', 'operator', 'value'] attribute_type = forms.ModelChoiceField(queryset=AttributeType.objects.all())