model for premiums
parent
f428634bf7
commit
92b91d2dbe
|
@ -6,5 +6,49 @@
|
|||
"domain": "unglue.it",
|
||||
"name": "unglue.it"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "core.premiums",
|
||||
"pk": 1,
|
||||
"fields":
|
||||
{
|
||||
"type": "00",
|
||||
"campign": "",
|
||||
"amount": 1,
|
||||
"description": "The unglued ebook delivered to your inbox."
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "core.premiums",
|
||||
"pk": 2,
|
||||
"fields":
|
||||
{
|
||||
"type": "00",
|
||||
"campign": "",
|
||||
"amount": 25,
|
||||
"description": 'Your name under "supporters" in the acknowledgements section.'
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "core.premiums",
|
||||
"pk": 3,
|
||||
"fields":
|
||||
{
|
||||
"type": "00",
|
||||
"campign": "",
|
||||
"amount": 50,
|
||||
"description": 'Your name & link of your choice under "benefactors"'
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "core.premiums",
|
||||
"pk": 4,
|
||||
"fields":
|
||||
{
|
||||
"type": "00",
|
||||
"campign": "",
|
||||
"amount": 100,
|
||||
"description": 'Your name, link of your choice, & a brief message (140 characters max) under "bibliophiles"'
|
||||
}
|
||||
},
|
||||
]
|
||||
|
|
|
@ -9,6 +9,13 @@ from django.contrib.auth.models import User
|
|||
class UnglueitError(RuntimeError):
|
||||
pass
|
||||
|
||||
class Premium(models.Model)
|
||||
PREMIUM_TYPES = ((u'00', u'Default'),(u'CU', u'Custom'))
|
||||
type = = models.CharField(max_length=2, choices=PREMIUM_TYPES)
|
||||
campaign = models.ForeignKey("Campaign", related_name="premiums", blank=True)
|
||||
amount = models.DecimalField(max_digits=10, decimal_places=0, blank=False)
|
||||
description = models.TextField(null=True, blank=False)
|
||||
|
||||
class Campaign(models.Model):
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
name = models.CharField(max_length=500, null=True, blank=False)
|
||||
|
|
Loading…
Reference in New Issue