-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bundle the FeinCMS page migrations so that tables are created in the …
…correct order
- Loading branch information
Showing
5 changed files
with
169 additions
and
1 deletion.
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
Empty file.
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,167 @@ | ||
# Generated by Django 2.1.5 on 2019-01-31 15:26 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import feincms.extensions.base | ||
import feincms.module.mixins | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [("form_designer", "0001_initial")] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="FormContent", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
( | ||
"show_form_title", | ||
models.BooleanField(default=True, verbose_name="show form title"), | ||
), | ||
( | ||
"success_message", | ||
models.TextField( | ||
help_text="Custom message to display after valid form is submitted", | ||
verbose_name="success message", | ||
), | ||
), | ||
("region", models.CharField(max_length=255)), | ||
("ordering", models.IntegerField(default=0, verbose_name="ordering")), | ||
( | ||
"form", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="page_formcontent_related", | ||
to="form_designer.Form", | ||
verbose_name="form", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "form", | ||
"verbose_name_plural": "forms", | ||
"db_table": "page_page_formcontent", | ||
"ordering": ["ordering"], | ||
"permissions": [], | ||
"abstract": False, | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name="Page", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("active", models.BooleanField(default=True, verbose_name="active")), | ||
( | ||
"title", | ||
models.CharField( | ||
help_text="This title is also used for navigation menu items.", | ||
max_length=200, | ||
verbose_name="title", | ||
), | ||
), | ||
( | ||
"slug", | ||
models.SlugField( | ||
help_text="This is used to build the URL for this page", | ||
max_length=150, | ||
verbose_name="slug", | ||
), | ||
), | ||
( | ||
"in_navigation", | ||
models.BooleanField(default=False, verbose_name="in navigation"), | ||
), | ||
( | ||
"override_url", | ||
models.CharField( | ||
blank=True, | ||
help_text="Override the target URL. Be sure to include slashes at the beginning and at the end if it is a local URL. This affects both the navigation and subpages' URLs.", | ||
max_length=255, | ||
verbose_name="override URL", | ||
), | ||
), | ||
( | ||
"redirect_to", | ||
models.CharField( | ||
blank=True, | ||
help_text="Target URL for automatic redirects or the primary key of a page.", | ||
max_length=255, | ||
verbose_name="redirect to", | ||
), | ||
), | ||
( | ||
"_cached_url", | ||
models.CharField( | ||
blank=True, | ||
db_index=True, | ||
default="", | ||
editable=False, | ||
max_length=255, | ||
verbose_name="Cached URL", | ||
), | ||
), | ||
("lft", models.PositiveIntegerField(db_index=True, editable=False)), | ||
("rght", models.PositiveIntegerField(db_index=True, editable=False)), | ||
("tree_id", models.PositiveIntegerField(db_index=True, editable=False)), | ||
("level", models.PositiveIntegerField(db_index=True, editable=False)), | ||
( | ||
"template_key", | ||
models.CharField( | ||
choices=[("base", "base")], | ||
default="base", | ||
max_length=255, | ||
verbose_name="template", | ||
), | ||
), | ||
( | ||
"parent", | ||
models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="children", | ||
to="page.Page", | ||
verbose_name="Parent", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "page", | ||
"verbose_name_plural": "pages", | ||
"ordering": ["tree_id", "lft"], | ||
}, | ||
bases=( | ||
models.Model, | ||
feincms.extensions.base.ExtensionsMixin, | ||
feincms.module.mixins.ContentModelMixin, | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="formcontent", | ||
name="parent", | ||
field=models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="formcontent_set", | ||
to="page.Page", | ||
), | ||
), | ||
] |
Empty file.
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