Skip to content
Advertisement

Tag: django-views

Django – store.models.Customer.MultipleObjectsReturned: get() returned more than one Customer — it returned 2″

I am trying to make an e-commerce website where “AnonymousUser” or Guest user can order and check out products by providing their name, email, and address. But after clicking the “Make Payment” button, my terminal was having an error that says “store.models.Customer.MultipleObjectsReturned: get() returned more than one Customer — it returned 2!” When I try to login and do the

get more than two foreign keys from another django table and perform calculations on them

In the Django app, I have created two tables. Product Invoice I have one table called Product which contains product name and product price columns are given. Then, I have a second table named Invoice which contains a product name(foreign key), product price(foreign key), discount, and total. My concern is how can I import both the values from the Product

I am trying to add a new field to the default Django Form and am getting an error when I’m trying to import a class from a forms.py file I made

The error is occurring in views.py file in which when I try to import the form class I made from my forms .py file I get an error of… Here is what my views.py file looks like: And here is my forms.py file Why am I getting that error/what am I missing? Answer You problem comes from importing “from django.contrib.auth

Advertisement