Skip to content
Advertisement

Tag: django

Django UpdateView with three different modelforms

I have a django UpdateView which needs to inherit three different models and different models. CreateView is working fine with three different modelforms. models.py: views.py: WHen I go to Update view, I am only able to update EmployeeAddModelForm values. But other form’s(WorkExperienceForm, EducationForm ) fields do not appear let alone edit the values of the fields. I suppose my views.py

Failing to install psycopg2-binary on new docker container

I have encountered a problem while trying to run my django project on a new Docker container. It is my first time using Docker and I can’t seem to find a good way to run a django project on it. Having tried multiple tutorials, I always get the error about psycopg2 not being installed. requirements.txt: Dockerfile: While running docker-compose build,

TypeError ‘Purchase’ object has no attribute ‘__getitem__’ [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question views.py def vendor(request,pk): current_shop = get_current_shop(request) instance =get_object_or_404(Vendor.objects.filter(pk=pk,shop=current_shop,is_deleted=False)) Answer purchases is a normal QuerySet that yields model instances when iterated over. All your other queries

Advertisement