please could you see this
-- https://ru.stackoverflow.com/questions/594743/forms-modelchoicefield-%d0%9a%d0%b0%d0%ba-%d0%bf%d0%be%d0%bb%d1%83%d1%87%d0%b8%d1%82%d1%8c-%d1%81-%d0%bf%d0%be%d0%bc%d0%be%d1%89%d1%8c%d1%8e-queryset-name-model-objects-filt
среда, 29 апреля 2020 г., 9:07:41 UTC+2 пользователь hend hend написал:
how to write this "form = KommpredForm(request.POST, user=user)" in views.py?
If I have Class and form_class
среда, 29 апреля 2020 г., 9:07:41 UTC+2 пользователь hend hend написал:
class OrderNewBigPrintView(LoginRequiredMixin , CustomSuccessMessageMixin , CreateView):
model = Order
template_name = 'new_order_bp.html'
form_class = OrderForm
success_url = reverse_lazy('orders' )
success_msg = 'Ok'# get_initial позволяет установить значения полей связанной формыdef get_initial(self):self.initial["name_job"] = TypJob.objects.filter(author__id =self.request.user.id)# вернуть нужно копию объектаreturn self.initial.copy()
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ead817cb-ab77-4c1c-803a-8aa4c3c7b02a%40googlegroups.com.
No comments:
Post a Comment