edecor / Backend

0 stars 0 forks source link

order model #32

Closed FiazAbrar closed 2 years ago

FiazAbrar commented 2 years ago
class Orders(models.Model):
    product = models.OneToOneField(Product) # oops probably need to use generic foreign key
    user = models.ForeignKey(settings.AUTH_USER_MODEL)
    date = DateField
    ...

Needs further research

FiazAbrar commented 2 years ago

wait ig OneToOneField will just not work. We need foreignkey with blank=True and null=True in every type of product

FiazAbrar commented 2 years ago

NO the above does not work. We need ManyToManyField with some sort of "count" of how many of each

FiazAbrar commented 2 years ago

finished for now with 4228a0b9d418c9da988145e735b99fecd2fbb371