Add order parameter to module
This commit is contained in:
parent
d884298413
commit
623afa8d0d
|
|
@ -24,6 +24,7 @@ class ModuleFactory(BasePageFactory):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Module
|
model = Module
|
||||||
|
|
||||||
|
order = 0
|
||||||
meta_title = factory.LazyAttribute(lambda x: fake.text(max_nb_chars=20))
|
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)))
|
teaser = factory.LazyAttribute(lambda x: fake.sentence(nb_words=random.randint(8, 12)))
|
||||||
description = factory.LazyAttribute(lambda x: fake.text(max_nb_chars=200))
|
description = factory.LazyAttribute(lambda x: fake.text(max_nb_chars=200))
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
@ -17,6 +17,7 @@ class Module(Page):
|
||||||
verbose_name = 'Modul'
|
verbose_name = 'Modul'
|
||||||
verbose_name_plural = 'Module'
|
verbose_name_plural = 'Module'
|
||||||
|
|
||||||
|
order = models.PositiveIntegerField(null=False, blank=False, help_text='Order of the module')
|
||||||
meta_title = models.CharField(
|
meta_title = models.CharField(
|
||||||
max_length=255,
|
max_length=255,
|
||||||
help_text='e.g. \'Intro\' or \'Modul 1\''
|
help_text='e.g. \'Intro\' or \'Modul 1\''
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue