# -*- coding: utf-8 -*-
from django import forms
from django.forms import ModelForm
from .models import *


class VendorForm(ModelForm):
    class Meta:
        model = Vendor
        fields = '__all__'
        
        widgets = {
            'company': forms.HiddenInput(),
            'products': forms.HiddenInput(),
            'agents': forms.HiddenInput(),
        }
    #def __init__(self, *args, **kwargs):
        #self._user = kwargs.pop('user')
        #super(StoreForm, self).__init__(*args, **kwargs)



#2022-03-21
class RedirectForm(ModelForm):
    class Meta:
        model = Redirect
        fields = '__all__'
        
        widgets = {
            #'company': forms.HiddenInput(),
            'products': forms.HiddenInput(),
            'agents': forms.HiddenInput(),
        }    

    def __init__(self, *args, **kwargs):       
        super(RedirectForm, self).__init__(*args, **kwargs)        
        self.fields['company'].widget.attrs['class'] = "form-control"
        self.fields['vendor'].widget.attrs['class'] = "form-control"
       





