from django import forms
from django.forms import ModelForm
from .models import * 
from django.utils.translation import gettext_lazy as _


class CategoryForm(ModelForm):
    class Meta:
        model = Category
        fields = ['name','remark']

# 2024-06-24
class PolicyForm(ModelForm):
    class Meta:
        model= Policy
        fields = '__all__'
        widgets = {
            'company': forms.HiddenInput(),
        }

    def __init__(self, *args, **kwargs):        
        super(PolicyForm, self).__init__(*args, **kwargs)
        #self.fields['company'].queryset = Company.objects.filter(level_id=1) 
        self.fields['dt_start'].widget.attrs['class'] = "datepicker"
        self.fields['dt_end'].widget.attrs['class'] = "datepicker"

