Skip to content

Commit 2742d16

Browse files
committed
Add template_slug to app model
1 parent b9714b7 commit 2742d16

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 4.2.1 on 2023-08-28 00:26
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('apps', '0001_initial'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='app',
15+
name='template_slug',
16+
field=models.CharField(blank=True, default=None, help_text='Slug of the template used for this app', max_length=100, null=True),
17+
),
18+
]

apps/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ class App(models.Model):
166166
template = models.ForeignKey(
167167
AppTemplate, on_delete=models.DO_NOTHING, help_text='Template used for this app', default=None, null=True, blank=True,
168168
)
169+
template_slug = models.CharField(
170+
max_length=100, help_text='Slug of the template used for this app', default=None, null=True, blank=True,
171+
)
169172
is_public = models.BooleanField(
170173
default=True, help_text='Whether the app is public or not',
171174
)
@@ -338,6 +341,7 @@ class TestCase(models.Model):
338341
auto_now=True, help_text='Time at which the app instance was last updated',
339342
)
340343

344+
341345
@receiver(pre_save, sender=App)
342346
def update_app_pre_save(sender, instance, **kwargs):
343347
from apps.app_types import AppTypeFactory

0 commit comments

Comments
 (0)