-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1297 from devinit/feature/update_focus_area_page_…
…type Feature | Update Focus Area Page Type
- Loading branch information
Showing
7 changed files
with
241 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Generated by Django 3.2.16 on 2023-03-02 01:59 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import django.utils.timezone | ||
import modelcluster.contrib.taggit | ||
import modelcluster.fields | ||
import wagtail.blocks | ||
import wagtail.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('taggit', '0005_auto_20220424_2025'), | ||
('project', '0047_auto_20221012_1214'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='focusareaspagelink', | ||
options={}, | ||
), | ||
migrations.RemoveField( | ||
model_name='focusareaspagelink', | ||
name='sort_order', | ||
), | ||
migrations.AddField( | ||
model_name='focusareaspagelink', | ||
name='related_page_handler', | ||
field=models.CharField(choices=[('manual', 'Manual'), ('topic', 'Topic')], default='manual', max_length=253, verbose_name='Show By'), | ||
), | ||
migrations.AddField( | ||
model_name='projectpage', | ||
name='published_date', | ||
field=models.DateTimeField(blank=True, default=django.utils.timezone.now, help_text='This date will be used for display and ordering'), | ||
), | ||
migrations.AlterField( | ||
model_name='focusareaspagelink', | ||
name='projects', | ||
field=wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock(required=True))], blank=True, null=True, use_json_field=True, verbose_name='Projects'), | ||
), | ||
migrations.CreateModel( | ||
name='FocusAreasPageLinkTopic', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('content_object', modelcluster.fields.ParentalKey(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='focus_areas_page_link_topics', to='project.focusareaspagelink')), | ||
('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='project_focusareaspagelinktopic_items', to='taggit.tag')), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
), | ||
migrations.AddField( | ||
model_name='focusareaspagelink', | ||
name='topics', | ||
field=modelcluster.contrib.taggit.ClusterTaggableManager(blank=True, help_text='A comma-separated list of tags.', through='project.FocusAreasPageLinkTopic', to='taggit.Tag', verbose_name='Topics'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Generated by Django 3.2.16 on 2023-03-02 02:00 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def add_published_date(apps, schema_editor): | ||
project = apps.get_model('project', 'ProjectPage') | ||
for project_page in project.objects.all(): | ||
if project_page.first_published_at is not None: | ||
project_page.published_date = project_page.first_published_at | ||
project_page.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('project', '0048_auto_20230302_0159'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(add_published_date), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Generated by Django 3.2.16 on 2023-03-02 02:24 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import modelcluster.contrib.taggit | ||
import modelcluster.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('taggit', '0005_auto_20220424_2025'), | ||
('project', '0049_auto_20230302_0200'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='ProjectPageTopic', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('content_object', modelcluster.fields.ParentalKey(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='project_page_topics', to='project.projectpage')), | ||
('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='project_projectpagetopic_items', to='taggit.tag')), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
), | ||
migrations.AddField( | ||
model_name='projectpage', | ||
name='topics', | ||
field=modelcluster.contrib.taggit.ClusterTaggableManager(blank=True, help_text='A comma-separated list of tags.', through='project.ProjectPageTopic', to='taggit.Tag', verbose_name='Topics'), | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
di_website/project/migrations/0051_focusareaspagelink_related_page_section_title.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 3.2.16 on 2023-03-02 08:09 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('project', '0050_auto_20230302_0224'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='focusareaspagelink', | ||
name='related_page_section_title', | ||
field=models.CharField(blank=True, default='Key Projects and Publications', max_length=255, verbose_name='Section Title'), | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
di_website/project/migrations/0052_alter_focusareaspagelink_related_page_section_title.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 3.2.15 on 2023-03-06 06:10 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('project', '0051_focusareaspagelink_related_page_section_title'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='focusareaspagelink', | ||
name='related_page_section_title', | ||
field=models.CharField(blank=True, default='Key projects and publications', max_length=255, verbose_name='Section Title'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters