I got a user-based dropdown working but now the form does not submit. here are my files
MODEL.PY name= models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True) FORMS.PY class MyForm(forms.ModelForm): class Meta: model = MyModel fields = ('name', ) def __init__(self, user, *args, **kwargs): self.user = user super(MyForm, self).__init__(*args, **kwargs) self.fields['name'].queryset = OtherModel.objects.filter(user=self.user) VIEWS.PY class MyView(CreateView): model = MyModel form_class = MyFrom template_name = 'users/form.html' success_url = reverse_lazy('index') def get_form_kwargs(self): kwargs = {'user' : self.request.user , } return kwargs {% extends 'users/backend.html' %} {% load static %} {% block main %} <form method="post" novalidate> {% csrf_token %} {{ form }} <button type="submit" class="btn btn-primary">Submit</button> </form> {% endblock %} NOTE: Without the def get_form_kwargs(self): in the views, the form filter grabs everything but with it does not submit. Any help will be appreciated -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/195b7d70-0afe-4079-979c-eb38061102den%40googlegroups.com.