Skip to content
Snippets Groups Projects
Commit b17e5bdb authored by Piotr Gawron's avatar Piotr Gawron
Browse files

two columns added for subject: information given, PD in family

parent 9ee6c91d
No related branches found
No related tags found
1 merge request!39Subject additional fields added
...@@ -63,6 +63,8 @@ def get_subjects_order(subjects, order_column, order_direction): ...@@ -63,6 +63,8 @@ def get_subjects_order(subjects, order_column, order_direction):
result = subjects.order_by(order_direction + 'dead') result = subjects.order_by(order_direction + 'dead')
elif order_column == "resigned": elif order_column == "resigned":
result = subjects.order_by(order_direction + 'resigned') result = subjects.order_by(order_direction + 'resigned')
elif order_column == "information_sent":
result = subjects.order_by(order_direction + 'information_sent')
elif order_column == "postponed": elif order_column == "postponed":
result = subjects.order_by(order_direction + 'postponed') result = subjects.order_by(order_direction + 'postponed')
return result return result
...@@ -87,6 +89,8 @@ def get_subjects_filtered(subjects, filters): ...@@ -87,6 +89,8 @@ def get_subjects_filtered(subjects, filters):
result = result.filter(resigned=(value == "true")) result = result.filter(resigned=(value == "true"))
elif column == "postponed": elif column == "postponed":
result = result.filter(postponed=(value == "true")) result = result.filter(postponed=(value == "true"))
elif column == "information_sent":
result = result.filter(information_sent=(value == "true"))
elif column == "default_location": elif column == "default_location":
result = result.filter(default_location=value) result = result.filter(default_location=value)
elif column == "": elif column == "":
...@@ -165,6 +169,7 @@ def serialize_subject(subject): ...@@ -165,6 +169,7 @@ def serialize_subject(subject):
"dead": get_yes_no(subject.dead), "dead": get_yes_no(subject.dead),
"resigned": get_yes_no(subject.resigned), "resigned": get_yes_no(subject.resigned),
"postponed": get_yes_no(subject.postponed), "postponed": get_yes_no(subject.postponed),
"information_sent": get_yes_no(subject.information_sent),
"id": subject.id, "id": subject.id,
} }
return result return result
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-04-04 14:16
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('web', '0028_location_color_of_flying_team'),
]
operations = [
migrations.AddField(
model_name='subject',
name='information_sent',
field=models.BooleanField(default=False, verbose_name=b'Information sent'),
),
migrations.AddField(
model_name='subject',
name='pd_in_family',
field=models.BooleanField(default=False, verbose_name=b'PD in family'),
),
]
...@@ -149,6 +149,14 @@ class Subject(models.Model): ...@@ -149,6 +149,14 @@ class Subject(models.Model):
default=False, default=False,
editable=True editable=True
) )
information_sent = models.BooleanField(
verbose_name='Information sent',
default=False
)
pd_in_family = models.BooleanField(
verbose_name='PD in family',
default=False,
)
resigned = models.BooleanField( resigned = models.BooleanField(
verbose_name='Resigned', verbose_name='Resigned',
default=False, default=False,
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
<th>Deceased</th> <th>Deceased</th>
<th>Resigned</th> <th>Resigned</th>
<th>Postponed</th> <th>Postponed</th>
<th>Info sent</th>
<th>Edit</th> <th>Edit</th>
</tr> </tr>
</thead> </thead>
...@@ -68,6 +69,9 @@ ...@@ -68,6 +69,9 @@
<th> <th>
<div name="yes_no_filter">---</div> <div name="yes_no_filter">---</div>
</th> </th>
<th>
<div name="yes_no_filter">---</div>
</th>
</tr> </tr>
</tfoot> </tfoot>
...@@ -117,10 +121,11 @@ ...@@ -117,10 +121,11 @@
{"data": "dead"}, {"data": "dead"},
{"data": "resigned"}, {"data": "resigned"},
{"data": "postponed"}, {"data": "postponed"},
{"data": "information_sent"},
{"data": null}, {"data": null},
], ],
columnDefs: [{ columnDefs: [{
"targets": 8, "targets": 9,
"data": "id", "data": "id",
"defaultContent": '<a href="#" type="button" class="btn btn-block btn-default">Edit</a>' "defaultContent": '<a href="#" type="button" class="btn btn-block btn-default">Edit</a>'
}] }]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment