diff --git a/opentech/public/projects/migrations/0003_projectpage_status.py b/opentech/public/projects/migrations/0003_projectpage_status.py new file mode 100644 index 0000000000000000000000000000000000000000..a8ec0880a43eb9b0fd7fbb4604af943b3f0e450a --- /dev/null +++ b/opentech/public/projects/migrations/0003_projectpage_status.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.8 on 2018-01-17 12:13 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0002_projectfunding'), + ] + + operations = [ + migrations.AddField( + model_name='projectpage', + name='status', + field=models.CharField(choices=[('idea', 'Just an Idea (Pre-alpha)'), ('exists', 'It Exists! (Alpha/Beta)'), ('release', "It's basically done. (Release)"), ('production', 'People Use It. (Production)')], default='idea', max_length=25), + ), + ] diff --git a/opentech/public/projects/models.py b/opentech/public/projects/models.py index b74a31b8c5c48ebeb6a79893005c34c77bd2136d..549db19672684ba0b89eb731a521ef0ab17f5471 100644 --- a/opentech/public/projects/models.py +++ b/opentech/public/projects/models.py @@ -83,6 +83,13 @@ class ProjectFunding(BaseFunding): class ProjectPage(FundingMixin, BasePage): + STATUSES = ( + ('idea', "Just an Idea (Pre-alpha)"), + ('exists', "It Exists! (Alpha/Beta)"), + ('release', "It's basically done. (Release)"), + ('production', "People Use It. (Production)"), + ) + subpage_types = [] parent_page_types = ['ProjectIndexPage'] @@ -94,12 +101,9 @@ class ProjectPage(FundingMixin, BasePage): related_name='+', on_delete=models.SET_NULL ) + status = models.CharField(choices=STATUSES, max_length=25, default=STATUSES[0][0]) body = StreamField(StoryBlock()) - # Fields to add: - # otf_status - # status - search_fields = BasePage.search_fields + [ index.SearchField('introduction'), index.SearchField('body'), @@ -108,6 +112,7 @@ class ProjectPage(FundingMixin, BasePage): content_panels = BasePage.content_panels + [ ImageChooserPanel('icon'), FieldPanel('introduction'), + FieldPanel('status'), StreamFieldPanel('body'), InlinePanel('contact_details', label="Contact Details"), InlinePanel('related_pages', label="Related pages"), @@ -116,6 +121,8 @@ class ProjectPage(FundingMixin, BasePage): class ProjectIndexPage(BasePage): + subpage_types = ['ProjectPage'] + parent_page_types = ['home.Homepage'] introduction = models.TextField(blank=True)