double the size of the content of Measurable class
This commit is contained in:
parent
d4979a2a57
commit
f59ed2527f
|
@ -14,12 +14,13 @@ class ChapterAdmin(admin.ModelAdmin):
|
|||
|
||||
|
||||
class StandardAdmin(admin.ModelAdmin):
|
||||
list_display = ('__str__', 'name', 'require_written_procedure')
|
||||
list_display = ('__str__', 'name', 'require_written_procedure', 'intent', 'number_of_measurables')
|
||||
list_filter = ('headline__acronym',)
|
||||
|
||||
|
||||
class IntentAdmin(admin.ModelAdmin):
|
||||
list_display = ('__str__',)
|
||||
inlines = [InlineStandard]
|
||||
|
||||
|
||||
admin.site.register(Intent, IntentAdmin)
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.5 on 2017-10-21 20:05
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jci', '0023_auto_20171019_1900'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='measurable',
|
||||
name='content',
|
||||
field=models.TextField(max_length=500),
|
||||
),
|
||||
]
|
|
@ -58,6 +58,9 @@ class Standard(models.Model):
|
|||
def structure(self):
|
||||
return self.order
|
||||
|
||||
def number_of_measurables(self):
|
||||
return self.measurables.count()
|
||||
|
||||
def __str__(self):
|
||||
return '{}.{}'.format(self.headline.acronym, self.structure)
|
||||
|
||||
|
@ -68,7 +71,7 @@ class Standard(models.Model):
|
|||
class Measurable(models.Model):
|
||||
standard = models.ForeignKey(Standard, related_name='measurables')
|
||||
order = models.IntegerField()
|
||||
content = models.TextField(max_length=255)
|
||||
content = models.TextField(max_length=500)
|
||||
|
||||
def __str__(self):
|
||||
return '{} ME {}'.format(self.standard, self.order)
|
||||
|
|
Loading…
Reference in New Issue