Add order parameter to module

This commit is contained in:
Pawel Kowalski 2018-08-08 15:39:28 +02:00
parent d884298413
commit 623afa8d0d
3 changed files with 21 additions and 0 deletions

View File

@ -24,6 +24,7 @@ class ModuleFactory(BasePageFactory):
class Meta:
model = Module
order = 0
meta_title = factory.LazyAttribute(lambda x: fake.text(max_nb_chars=20))
teaser = factory.LazyAttribute(lambda x: fake.sentence(nb_words=random.randint(8, 12)))
description = factory.LazyAttribute(lambda x: fake.text(max_nb_chars=200))

View File

@ -0,0 +1,19 @@
# Generated by Django 2.0.6 on 2018-08-08 13:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('book', '0002_topic_order'),
]
operations = [
migrations.AddField(
model_name='module',
name='order',
field=models.PositiveIntegerField(default=0, help_text='Order of the module'),
preserve_default=False,
),
]

View File

@ -17,6 +17,7 @@ class Module(Page):
verbose_name = 'Modul'
verbose_name_plural = 'Module'
order = models.PositiveIntegerField(null=False, blank=False, help_text='Order of the module')
meta_title = models.CharField(
max_length=255,
help_text='e.g. \'Intro\' or \'Modul 1\''