from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.signals import pre_delete
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import gettext_lazy as _
from catalogue.models import Book, Tag
complete = models.BooleanField(default=False)
last_changed = models.DateTimeField(auto_now=True)
+ class Meta:
+ unique_together = [('user', 'book')]
+
@property
def state(self):
return 'complete' if self.complete else 'reading'