Skip to content

Commit 1d7b621

Browse files
committed
Изменена модель Тип подписки: добавлено поле уровень подписки
1 parent a858e8c commit 1d7b621

2 files changed

Lines changed: 34 additions & 3 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Generated by Django 5.0.3 on 2025-04-15 06:06
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("subscription", "0002_alter_subscriptiontype_features_and_more"),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name="subscriptiontype",
15+
name="subscription_level",
16+
field=models.CharField(
17+
choices=[("Start", "Start"), ("PRO", "PRO"), ("PRO+", "PRO+")],
18+
max_length=30,
19+
null=True,
20+
unique=True,
21+
verbose_name="Уровень подписки",
22+
),
23+
),
24+
migrations.AlterField(
25+
model_name="subscriptiontype",
26+
name="name",
27+
field=models.CharField(max_length=30, verbose_name="Название подписки"),
28+
),
29+
]

apps/subscription/models.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ class SubscriptionType(models.Model):
88
("PRO", "PRO"),
99
("PRO+", "PRO+"),
1010
]
11-
1211
name = models.CharField(
12+
null=False, blank=False, verbose_name="Название подписки", max_length=30
13+
)
14+
subscription_level = models.CharField(
1315
choices=SUBSCRIPTION_CHOICES,
1416
unique=True,
15-
null=False,
17+
null=True,
1618
blank=False,
17-
verbose_name="Название подписки",
19+
verbose_name="Уровень подписки",
1820
max_length=30,
1921
)
2022
price = models.IntegerField(

0 commit comments

Comments
 (0)