mirror of
https://github.com/pretix/pretix.git
synced 2026-05-08 15:44:02 +00:00
migration, show category type in ui
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
# Generated by Django 4.2.11 on 2024-05-27 13:19
|
||||
|
||||
from django.db import migrations, models
|
||||
import pretix.base.models.orders
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("pretixbase", "0264_order_internal_secret"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="itemcategory",
|
||||
name="cross_selling_condition",
|
||||
field=models.CharField(null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="itemcategory",
|
||||
name="cross_selling_mode",
|
||||
field=models.CharField(null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="itemcategory",
|
||||
name="cross_selling_match_products",
|
||||
field=models.ManyToManyField(
|
||||
related_name="matched_by_cross_selling_categories", to="pretixbase.item"
|
||||
),
|
||||
),
|
||||
]
|
||||
@@ -158,6 +158,8 @@ class ItemCategory(LoggedModel):
|
||||
name = self.internal_name or self.name
|
||||
if self.is_addon:
|
||||
return _('{category} (Add-On products)').format(category=str(name))
|
||||
if self.cross_selling_mode is not None:
|
||||
return _('{category} ({category_type})').format(category=str(name), category_type=self.get_cross_selling_mode_display())
|
||||
return str(name)
|
||||
|
||||
def get_category_type_display(self):
|
||||
|
||||
Reference in New Issue
Block a user