Add SectionWithImage model and its migration

This commit is contained in:
M.Ravi 2017-10-19 00:28:34 +02:00
parent 38330d562c
commit 8ce273ea1f
2 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2017-10-18 22:02
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import filer.fields.image
class Migration(migrations.Migration):
dependencies = [
('filer', '0004_auto_20160328_1434'),
('ungleich_page', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='SectionWithImage',
fields=[
('ungelichpicture_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='ungleich_page.UngelichPicture')),
('price_tag_url', models.URLField(default='', max_length=300)),
('price_tag_image', filer.fields.image.FilerImageField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='price_tag_image', to='filer.Image')),
],
options={
'abstract': False,
},
bases=('ungleich_page.ungelichpicture',),
),
]

View file

@ -14,6 +14,16 @@ class UngelichPicture(CMSPlugin):
title = models.CharField(max_length=400)
class SectionWithImage(UngelichPicture):
price_tag_image = FilerImageField(
null=True,
blank=True,
related_name="price_tag_image",
on_delete=models.SET_NULL
)
price_tag_url = models.URLField(max_length=300, default="")
class UngelichContactUsSection(CMSPlugin):
email = models.EmailField(max_length=200)