Comments (2)
I have model Shop, Product, Customer, Order. the relation of model
shop
user = models.OneToOneField(User, null=True, related_name='shop', blank=True,
on_delete=models.CASCADE)
name = models.CharField(max_length=70, null=True, default='shop', )
address = models.CharField(max_length=70, null=True)`
customer
`
class Customer(models.Model):
user = models.OneToOneField(User, null=True, on_delete=models.CASCADE)
name = models.CharField(max_length=100, null=True, default='customer')
Phone = models.PositiveIntegerField(blank=True, null=True)`
product
`
class Product(models.Model):
shop = models.ForeignKey(Shop, models.CASCADE, null=True, blank=True)
name = models.CharField(max_length=100, blank=True)
Brand = models.CharField(max_length=200, blank=True)
description = models.TextField(null=True, blank=True)`
order
`
class Order(models.Model):
STATUS = (
('Pending', 'Pending'),
('Out for delivery', 'Out for delivery'),
('Delivered', 'Delivered'),
)
shop = models.ForeignKey(Shop, models.CASCADE, null=True)
customer = models.ForeignKey(Customer, models.CASCADE, null=True)
product = models.ForeignKey(Product, models.CASCADE, null=True)
quantity = models.CharField(max_length=30)
date_created = models.DateTimeField(auto_now_add=True)
status = models.CharField(max_length=200, choices=STATUS, default='Pending')`
when customers login then the list of shops will print on the screen and a button on shop to show the products by the shop in the form card. On the product card, there is an order button that adds the product in order after submitting the selected product will print with the remaining filled of order
how I can create an order so that the customer in order is the instance and the shop in order is that shop which is selected to show the products, and products which are selected for the order, please explain me
from django-ecommerce.
Please consider posting questions like this on StackOverflow. Issues are to keep track of issues
from django-ecommerce.
Related Issues (20)
- import error HOT 1
- Code not indented properly
- No models.py file HOT 1
- ImportError: cannot import name 'config' from 'decouple HOT 4
- Is this project still open to contribution?
- Is this project is now also open or it has been closed?
- Error when running requirements.txt install (cannot build wheels for pillow) HOT 7
- items in Order (many to many fields) HOT 2
- ModuleNotFoundError: No module named 'decouple' HOT 2
- cannot import 'config' from 'decouple'
- MultipleObjectsReturned at /product/shirt/ get() returned more than one Item -- it returned 2!
- I have the same problem.
- pip install -r requirements.text
- Invalid Parameter Error HOT 2
- Pillow 6.2.2 HOT 1
- Import "_frozen_importlib" could not be resolved and Import "_frozen_importlib_external" could not be resolved HOT 1
- Facility to login as an admin user. Admin user can add, edit or delete a product
- Attribute Error
- Failed to load media/images HOT 2
- ModuleNotFoundError: allauth HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-ecommerce.