add content for measurable and change the many to many foreign key
This commit is contained in:
parent
008e785154
commit
0d837d5fa8
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
|
@ -1,6 +1,6 @@
|
|||
from django.contrib import admin
|
||||
|
||||
from .models import Chapter, Section, Standard
|
||||
from .models import Chapter, Section, Standard, Measurable
|
||||
|
||||
|
||||
class InlineStandard(admin.StackedInline):
|
||||
|
@ -21,3 +21,4 @@ class StandardAdmin(admin.ModelAdmin):
|
|||
admin.site.register(Chapter, ChapterAdmin)
|
||||
admin.site.register(Standard, StandardAdmin)
|
||||
admin.site.register(Section)
|
||||
admin.site.register(Measurable)
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.5 on 2017-10-19 15:14
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jci', '0018_auto_20171019_1354'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='measurable',
|
||||
name='content',
|
||||
field=models.CharField(default='', max_length=255),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
|
@ -52,8 +52,9 @@ class Standard(models.Model):
|
|||
|
||||
class Measurable(models.Model):
|
||||
standard = models.ForeignKey(Standard, related_name='measurables')
|
||||
linked_standards = models.ManyToManyField(Standard, related_name='linked_measurables')
|
||||
see_also = models.ManyToManyField('self')
|
||||
order = models.IntegerField()
|
||||
content = models.CharField(max_length=255)
|
||||
|
||||
class Meta:
|
||||
unique_together = ('standard', 'order')
|
||||
|
|
Loading…
Reference in New Issue