def __init__(self, user, *args, **kwargs):
super(Form, self).__init__(*args, **kwargs)
self.fields['category'].queryset = Category.objects.all().filter(user=user)
class UpdateView(UpdateView):
model = Model
success_url = '/account/model'
template_name = 'main/model.html'
form_class = Form