# coding=utf-8

from django.db import models
from django.utils import timezone

from apps.customer.models import Customer
from apps.commodity.models import Commodity


class Collection(models.Model):

    customer = models.ForeignKey(Customer, verbose_name=u'收藏人', on_delete=models.PROTECT)
    commodity = models.ForeignKey(Commodity, verbose_name=u'收藏商品', on_delete=models.PROTECT)
    create_time = models.DateTimeField(verbose_name=u'收藏时间', default=timezone.now, editable=False)

    class Meta:
        db_table = "collection"
        verbose_name = u'收藏'
        ordering = ['-id']
        default_permissions = ()


