1
Fork 0

Remove unnecessary fields

This commit is contained in:
Jake Howard 2016-11-28 18:48:41 +00:00
parent d50952a6e5
commit b18974bcd7
4 changed files with 5 additions and 14 deletions

View file

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-25 21:49 # Generated by Django 1.10.3 on 2016-11-28 18:43
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
@ -20,7 +20,6 @@ class Migration(migrations.Migration):
name='SectionIndexPage', name='SectionIndexPage',
fields=[ fields=[
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')), ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
('name', models.CharField(max_length=250)),
('intro', wagtail.wagtailcore.fields.RichTextField(blank=True)), ('intro', wagtail.wagtailcore.fields.RichTextField(blank=True)),
('hide_list', models.BooleanField(default=False)), ('hide_list', models.BooleanField(default=False)),
], ],

View file

@ -12,12 +12,10 @@ class Entity(Page):
class SectionIndexPage(Entity): class SectionIndexPage(Entity):
name = models.CharField(max_length=250)
intro = RichTextField(blank=True) intro = RichTextField(blank=True)
hide_list = models.BooleanField(default=False) hide_list = models.BooleanField(default=False)
content_panels = Page.content_panels + [ content_panels = Page.content_panels + [
FieldPanel('name'),
FieldPanel('intro', classname="full"), FieldPanel('intro', classname="full"),
FieldPanel('hide_list') FieldPanel('hide_list')
] ]

View file

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-25 23:10 # Generated by Django 1.10.3 on 2016-11-28 18:42
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
@ -23,8 +23,7 @@ class Migration(migrations.Migration):
name='ProjectPage', name='ProjectPage',
fields=[ fields=[
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')), ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
('date', models.DateField(verbose_name='Post date')), ('summary', models.CharField(max_length=500)),
('intro', models.CharField(max_length=250)),
('body', wagtail.wagtailcore.fields.RichTextField()), ('body', wagtail.wagtailcore.fields.RichTextField()),
('url', models.URLField(blank=True, validators=[project.projects.models.validate_url])), ('url', models.URLField(blank=True, validators=[project.projects.models.validate_url])),
('download_url', models.URLField(blank=True, validators=[project.projects.models.validate_url])), ('download_url', models.URLField(blank=True, validators=[project.projects.models.validate_url])),

View file

@ -31,8 +31,7 @@ class ProjectPage(Entity):
on_delete=models.SET_NULL, on_delete=models.SET_NULL,
related_name='+' related_name='+'
) )
date = models.DateField("Post date") summary = models.CharField(max_length=500)
intro = models.CharField(max_length=250)
body = RichTextField() body = RichTextField()
url = models.URLField(validators=[validate_url], blank=True) url = models.URLField(validators=[validate_url], blank=True)
download_url = models.URLField(validators=[validate_url], blank=True) download_url = models.URLField(validators=[validate_url], blank=True)
@ -44,18 +43,14 @@ class ProjectPage(Entity):
related_name='+' related_name='+'
) )
def get_download_url(self):
return self.download_url or self.asset.url
search_fields = Page.search_fields + [ search_fields = Page.search_fields + [
index.SearchField('intro'), index.SearchField('intro'),
index.SearchField('body'), index.SearchField('body'),
] ]
content_panels = Page.content_panels + [ content_panels = Page.content_panels + [
FieldPanel('date'),
ImageChooserPanel('main_image'), ImageChooserPanel('main_image'),
FieldPanel('intro'), FieldPanel('summary'),
FieldPanel('body'), FieldPanel('body'),
FieldPanel('url'), FieldPanel('url'),
FieldPanel('download_url'), FieldPanel('download_url'),