root
6 years ago
7 changed files with 121 additions and 3 deletions
@ -0,0 +1,33 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.8 on 2018-08-22 18:32 |
|||
from __future__ import unicode_literals |
|||
|
|||
import django.core.validators |
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
import markdownx.models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('content', '0010_auto_20180222_1319'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='content', |
|||
name='photo', |
|||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='main_photo', to='photologue.Photo'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='content', |
|||
name='schedule', |
|||
field=markdownx.models.MarkdownxField(blank=True, default='', null=True), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='content', |
|||
name='teaser', |
|||
field=models.TextField(blank=True, null=True, validators=[django.core.validators.MaxLengthValidator(250)]), |
|||
), |
|||
] |
@ -0,0 +1,21 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.8 on 2018-08-22 19:08 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations |
|||
import sortedm2m.fields |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('content', '0011_auto_20180822_1832'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='content', |
|||
name='related_content', |
|||
field=sortedm2m.fields.SortedManyToManyField(help_text=None, to='content.Content'), |
|||
), |
|||
] |
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.8 on 2018-08-22 19:08 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations |
|||
|
|||
def migrate_relations(apps, schema_editor): |
|||
Content = apps.get_model("content", "Content") |
|||
for c in Content.objects.all(): |
|||
for r in c.parents.all(): |
|||
c.related_content.add(r) |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('content', '0012_content_related_content'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.RunPython(migrate_relations), |
|||
] |
|||
|
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.8 on 2018-08-22 19:08 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations |
|||
|
|||
def migrate_shortname(apps, schema_editor): |
|||
Content = apps.get_model("content", "Content") |
|||
for c in Content.objects.filter(shortname__contains=' '): |
|||
c.shortname = c.shortname.replace(' ', '_') |
|||
c.save() |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('content', '0013_related'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.RunPython(migrate_shortname), |
|||
] |
|||
|
Loading…
Reference in new issue