X-Git-Url: https://git.mdrn.pl/prawokultury.git/blobdiff_plain/1ede7c2fdb4bc8345e778ab734b0c3e59fdeb32a..b64d44fd01d504fbcbf3a180f9e620fed6d527ed:/shop/models.py?ds=sidebyside diff --git a/shop/models.py b/shop/models.py index aca0703..47cace3 100644 --- a/shop/models.py +++ b/shop/models.py @@ -16,7 +16,7 @@ from . import app_settings class Offer(models.Model): """ A fundraiser for a particular book. """ - entry = models.OneToOneField(Entry) # filter publications! + entry = models.OneToOneField(Entry, models.CASCADE) # filter publications! price = models.DecimalField(_('price'), decimal_places=2, max_digits=6) cost_const = models.DecimalField(decimal_places=2, max_digits=6) cost_per_item = models.DecimalField(decimal_places=2, max_digits=6, default=0) @@ -45,7 +45,7 @@ class Order(models.Model): The payment was completed if and only if payed_at is set. """ - offer = models.ForeignKey(Offer, verbose_name=_('offer')) + offer = models.ForeignKey(Offer, models.CASCADE, verbose_name=_('offer')) items = models.IntegerField(verbose_name=_('items'), default=1) name = models.CharField(_('name'), max_length=127, blank=True) email = models.EmailField(_('email'), db_index=True)