From f684f8e8b70dc26a359939dff99dce7661e496fb Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Wed, 11 Mar 2020 17:01:22 +0000 Subject: added oes designator to org --- .../migrations/0006_organisation_oes.py | 19 +++++++++++++++ ctrack/organisations/models.py | 1 + .../organisations/organisation_detail.html | 27 ++++++++++++++-------- ctrack/organisations/tests/factories.py | 1 + 4 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 ctrack/organisations/migrations/0006_organisation_oes.py diff --git a/ctrack/organisations/migrations/0006_organisation_oes.py b/ctrack/organisations/migrations/0006_organisation_oes.py new file mode 100644 index 0000000..17edfb5 --- /dev/null +++ b/ctrack/organisations/migrations/0006_organisation_oes.py @@ -0,0 +1,19 @@ +# Generated by Django 2.2.9 on 2020-03-11 16:56 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('organisations', '0005_auto_20200303_0727'), + ] + + operations = [ + migrations.AddField( + model_name='organisation', + name='oes', + field=models.BooleanField(default=True), + preserve_default=False, + ), + ] diff --git a/ctrack/organisations/models.py b/ctrack/organisations/models.py index 4de9888..7829b95 100644 --- a/ctrack/organisations/models.py +++ b/ctrack/organisations/models.py @@ -123,6 +123,7 @@ class Organisation(models.Model): submode = models.ForeignKey( Submode, on_delete=models.CASCADE, blank=True, null=True ) + oes = models.BooleanField() designation_type = models.IntegerField(choices=DESIGNATION_TYPE, default=1) registered_company_name = models.CharField(max_length=255, blank=True) registered_company_number = models.CharField(max_length=100, blank=True) diff --git a/ctrack/organisations/templates/organisations/organisation_detail.html b/ctrack/organisations/templates/organisations/organisation_detail.html index 836dec2..59b31db 100644 --- a/ctrack/organisations/templates/organisations/organisation_detail.html +++ b/ctrack/organisations/templates/organisations/organisation_detail.html @@ -27,6 +27,15 @@ Designation Type: {{ object.designation_type }} + + OES: + {% if object.oes %} + Yes + {% else %} + No + {% endif %} + + Registered Company Name: {{ object.registered_company_name }} @@ -62,15 +71,15 @@
{% for ass in applicable_systems %} - - - - + + + + {% endfor %}
{{ ass.name }}{{ ass.description }}
- - {{ ass.caf }} - | System Detail - | Edit System -
{{ ass.name }}{{ ass.description }}
+ + {{ ass.caf }} + | System Detail + | Edit System +
diff --git a/ctrack/organisations/tests/factories.py b/ctrack/organisations/tests/factories.py index 38e6079..3550f6e 100644 --- a/ctrack/organisations/tests/factories.py +++ b/ctrack/organisations/tests/factories.py @@ -47,6 +47,7 @@ class OrganisationFactory(DjangoModelFactory): name = Faker("company") slug = Faker("lexify", text="????", letters="abcdsg") designation_type = 1 + oes = factory.LazyFunction(lambda : random.choice([True, False])) registered_company_name = Faker("company") registered_company_number = Faker("numerify", text="######") date_updated = Faker("date_this_year", before_today=True) -- cgit v1.2.3