mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Customer accounts & Memberships (#2024)
This commit is contained in:
@@ -514,6 +514,34 @@ class Item(LoggedModel):
|
||||
'product price.'),
|
||||
default=False
|
||||
)
|
||||
require_membership = models.BooleanField(
|
||||
verbose_name=_('Require a valid membership'),
|
||||
default=False,
|
||||
)
|
||||
require_membership_types = models.ManyToManyField(
|
||||
'MembershipType',
|
||||
verbose_name=_('Allowed membership types'),
|
||||
blank=True,
|
||||
)
|
||||
grant_membership_type = models.ForeignKey(
|
||||
'MembershipType',
|
||||
null=True, blank=True,
|
||||
related_name='granted_by',
|
||||
on_delete=models.PROTECT,
|
||||
verbose_name=_('This product creates a membership of type'),
|
||||
)
|
||||
grant_membership_duration_like_event = models.BooleanField(
|
||||
verbose_name=_('The duration of the membership is the same as the duration of the event or event series date'),
|
||||
default=True,
|
||||
)
|
||||
grant_membership_duration_days = models.IntegerField(
|
||||
verbose_name=_('Membership duration in days'),
|
||||
default=0,
|
||||
)
|
||||
grant_membership_duration_months = models.IntegerField(
|
||||
verbose_name=_('Membership duration in months'),
|
||||
default=0,
|
||||
)
|
||||
# !!! Attention: If you add new fields here, also add them to the copying code in
|
||||
# pretix/control/forms/item.py if applicable.
|
||||
|
||||
@@ -760,6 +788,15 @@ class ItemVariation(models.Model):
|
||||
help_text=_('If set, this will be displayed next to the current price to show that the current price is a '
|
||||
'discounted one. This is just a cosmetic setting and will not actually impact pricing.')
|
||||
)
|
||||
require_membership = models.BooleanField(
|
||||
verbose_name=_('Require a valid membership'),
|
||||
default=False,
|
||||
)
|
||||
require_membership_types = models.ManyToManyField(
|
||||
'MembershipType',
|
||||
verbose_name=_('Membership types'),
|
||||
blank=True,
|
||||
)
|
||||
|
||||
objects = ScopedManager(organizer='item__event__organizer')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user