Answer the question
In order to leave comments, you need to log in
How to choose the correct ratio of fields in this case?
I'm making a small corporate service using Django. Essence. There is some item . Available names of these products are created in the admin panel. Then, on the site, the user forms Applications from these goods. At the same time, in one application there can be only 1 product, but several pieces. Then the user can form an Order from Applications . At the same time, I must be sure that the same application will not fall into different orders.
class Product(models.Model):
title = models.CharField()
class Order(models.Model):
order_product = models.ForeignKey(Product)
order_date = models.DateField( )
number = models.IntegerField( )
class Proposal(models.Model):
order_list = models.ManyToManyField(Order) # Какое правильно выставить отношение?
Answer the question
In order to leave comments, you need to log in
If I understand correctly, you have an online store according to the scheme: you come, add goods to the basket and place an order. How I did it:
order.session=request.session
python manage.py clearsessions
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question