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 -*-
# 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 django.db import migrations, models
@ -20,7 +20,6 @@ class Migration(migrations.Migration):
name='SectionIndexPage',
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')),
('name', models.CharField(max_length=250)),
('intro', wagtail.wagtailcore.fields.RichTextField(blank=True)),
('hide_list', models.BooleanField(default=False)),
],

View file

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

View file

@ -1,5 +1,5 @@
# -*- 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 django.db import migrations, models
@ -23,8 +23,7 @@ class Migration(migrations.Migration):
name='ProjectPage',
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')),
('date', models.DateField(verbose_name='Post date')),
('intro', models.CharField(max_length=250)),
('summary', models.CharField(max_length=500)),
('body', wagtail.wagtailcore.fields.RichTextField()),
('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,
related_name='+'
)
date = models.DateField("Post date")
intro = models.CharField(max_length=250)
summary = models.CharField(max_length=500)
body = RichTextField()
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='+'
)
def get_download_url(self):
return self.download_url or self.asset.url
search_fields = Page.search_fields + [
index.SearchField('intro'),
index.SearchField('body'),
]
content_panels = Page.content_panels + [
FieldPanel('date'),
ImageChooserPanel('main_image'),
FieldPanel('intro'),
FieldPanel('summary'),
FieldPanel('body'),
FieldPanel('url'),
FieldPanel('download_url'),