Advertisement
Guest User

Untitled

a guest
May 20th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. class JobForm(ModelForm):
  2.     class Meta:
  3.         fields= '__all__'
  4.         model = Job
  5.         widgets = {
  6.             'job_description': Textarea(attrs={'cols': 40, 'rows': 8}),
  7.             'job_requirements': Textarea(attrs={'cols': 40, 'rows': 12}),
  8.         }
  9.  
  10.     def __init__(self, user=None,*args,**kwargs):
  11.         super(JobForm, self).__init__(*args,**kwargs)
  12.         if user:
  13.             self.fields['job_company'].queryset = Company.objects.filter(user=user)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement