mirror of
https://github.com/jazzband/django-categories.git
synced 2026-03-16 22:30:24 +00:00
[-] Add migrations for simpletext example app
This commit is contained in:
parent
9a71474b15
commit
408e69d010
2 changed files with 49 additions and 0 deletions
49
example/simpletext/migrations/0001_initial.py
Normal file
49
example/simpletext/migrations/0001_initial.py
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.9.13 on 2017-10-12 20:27
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import mptt.fields
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = []
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='SimpleCategory',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=100, verbose_name='name')),
|
||||
('slug', models.SlugField(verbose_name='slug')),
|
||||
('active', models.BooleanField(default=True, verbose_name='active')),
|
||||
('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)),
|
||||
('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='simpletext.SimpleCategory', verbose_name='parent')),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'simple categories',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SimpleText',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255)),
|
||||
('description', models.TextField(blank=True)),
|
||||
('created', models.DateTimeField(auto_now_add=True)),
|
||||
('updated', models.DateTimeField(auto_now=True)),
|
||||
],
|
||||
options={
|
||||
'ordering': ('-created',),
|
||||
'get_latest_by': 'updated',
|
||||
'verbose_name_plural': 'Simple Text',
|
||||
},
|
||||
),
|
||||
]
|
||||
0
example/simpletext/migrations/__init__.py
Normal file
0
example/simpletext/migrations/__init__.py
Normal file
Loading…
Reference in a new issue