Added migrations, fixed queryset call and fixed meta inheritance for self-referential sample model.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
import adminsortable.fields
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('app', '0002_nonsortablecategory_sortablecategorywidget'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='SelfReferentialCategory',
|
||||
fields=[
|
||||
('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')),
|
||||
('order', models.PositiveIntegerField(db_index=True, editable=False, default=1)),
|
||||
('title', models.CharField(max_length=50)),
|
||||
('child', adminsortable.fields.SortableForeignKey(to='app.SelfReferentialCategory')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
import adminsortable.fields
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('app', '0003_selfreferentialcategory'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='selfreferentialcategory',
|
||||
options={'verbose_name_plural': 'Sortable Referential Categories', 'verbose_name': 'Sortable Referential Category'},
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='selfreferentialcategory',
|
||||
name='child',
|
||||
field=adminsortable.fields.SortableForeignKey(to='app.SelfReferentialCategory', null=True, blank=True),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user