from django db import models from django contrib auth models import Us

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
from django.db import models
from django.contrib.auth.models import User
from hanut.products.models import Products
class Carts(models.Model):
user = models.ForeignKey(User)
items = models.ManyToManyField(Products)
class Admin:
list_display = ('user',)
class Meta:
verbose_name = u'Cart'
verbose_name_plural = u'Carts'