From 73c8e6ad1f215d7f0f8d91c5d89a1a5e130e8609 Mon Sep 17 00:00:00 2001 From: Aakash Singh Date: Sun, 22 Dec 2024 11:50:43 +0530 Subject: [PATCH] add facility description closes https://github.com/ohcnetwork/care_fe/issues/9523 --- care/facility/api/serializers/facility.py | 2 ++ .../migrations/0471_facility_description.py | 18 ++++++++++++++++++ care/facility/models/facility.py | 1 + 3 files changed, 21 insertions(+) create mode 100644 care/facility/migrations/0471_facility_description.py diff --git a/care/facility/api/serializers/facility.py b/care/facility/api/serializers/facility.py index bd42b9bba4..91e36f9d71 100644 --- a/care/facility/api/serializers/facility.py +++ b/care/facility/api/serializers/facility.py @@ -77,6 +77,7 @@ class Meta: fields = ( "id", "name", + "description", "local_body", "district", "state", @@ -113,6 +114,7 @@ class Meta: fields = [ "id", "name", + "description", "ward", "local_body", "district", diff --git a/care/facility/migrations/0471_facility_description.py b/care/facility/migrations/0471_facility_description.py new file mode 100644 index 0000000000..bf2ec61226 --- /dev/null +++ b/care/facility/migrations/0471_facility_description.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.3 on 2024-12-22 06:20 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('facility', '0470_alter_historicalpatientregistration_is_antenatal_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='facility', + name='description', + field=models.TextField(blank=True), + ), + ] diff --git a/care/facility/models/facility.py b/care/facility/models/facility.py index 01c0102b10..19cef7ac80 100644 --- a/care/facility/models/facility.py +++ b/care/facility/models/facility.py @@ -215,6 +215,7 @@ def check_if_spoke_is_not_ancestor(base_id: int, spoke_id: int): class Facility(FacilityBaseModel, FacilityPermissionMixin): name = models.CharField(max_length=1000, blank=False, null=False) + description = models.TextField(blank=True, null=False) is_active = models.BooleanField(default=True) verified = models.BooleanField(default=False) facility_type = models.IntegerField(choices=FACILITY_TYPES)