forked from CGM_Public/pretix_original
Order-level questions (#6471)
* New CheckoutSession model, created and deleted throught cart lifetime but only used for order-level question answers so far * Order-level QuestionAnswers (relations to CheckoutSession / Order) * New container_type field on Question model to specify whether Question belongs to order or orderposition * Order-level questions are currently experimental, UI is hidden behind feature flag --------- Co-authored-by: Richard Schreiber <schreiber@pretix.eu>
This commit is contained in:
co-authored by
Richard Schreiber
parent
b241adb7d0
commit
f8cc31b120
@@ -1606,6 +1606,9 @@ class Question(LoggedModel):
|
||||
:param dependency_values: The values that `dependency_question` needs to be set to for this question to be applicable.
|
||||
:type dependency_values: list[str]
|
||||
"""
|
||||
class ContainerType(models.TextChoices):
|
||||
ORDER = "O", _("Order")
|
||||
ORDERPOSITION = "P", _("Order position")
|
||||
TYPE_NUMBER = "N"
|
||||
TYPE_STRING = "S"
|
||||
TYPE_TEXT = "T"
|
||||
@@ -1641,6 +1644,12 @@ class Question(LoggedModel):
|
||||
related_name="questions",
|
||||
on_delete=models.CASCADE
|
||||
)
|
||||
container_type = models.CharField(
|
||||
max_length=5,
|
||||
choices=ContainerType.choices,
|
||||
verbose_name=_("Asked on"),
|
||||
default=ContainerType.ORDERPOSITION,
|
||||
)
|
||||
question = I18nTextField(
|
||||
verbose_name=_("Question")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user