Skip to content

Commit

Permalink
Remove multiselectfield references (#2444)
Browse files Browse the repository at this point in the history
  • Loading branch information
sainak authored Sep 12, 2024
1 parent 4f6296a commit 473a648
Show file tree
Hide file tree
Showing 18 changed files with 51 additions and 78 deletions.
1 change: 0 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ django-cors-headers = "==4.3.1"
django-filter = "==24.2"
django-maintenance-mode = "==0.21.1"
django-model-utils = "==4.5.1"
django-multiselectfield = "==0.1.12"
django-queryset-csv = "==1.1.0"
django-ratelimit = "==4.1.0"
django-redis = "==5.4.0"
Expand Down
10 changes: 1 addition & 9 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions care/audit_log/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from typing import List, NamedTuple

from django.conf import settings
from multiselectfield.db.fields import MSFList
from rest_framework.utils.encoders import JSONEncoder


Expand All @@ -15,7 +14,7 @@ def remove_non_member_fields(d: dict):
def instance_finder(v):
return isinstance(
v,
(list, dict, set, MSFList),
(list, dict, set),
)


Expand Down
9 changes: 4 additions & 5 deletions care/facility/migrations/0001_initial_squashed.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import django.core.validators
import django.db.models.deletion
import django.utils.timezone
import multiselectfield.db.fields
import simple_history.models
from django.conf import settings
from django.db import migrations, models
Expand Down Expand Up @@ -1039,7 +1038,7 @@ class Migration(migrations.Migration):
("physical_examination_info", models.TextField(blank=True, null=True)),
(
"additional_symptoms",
multiselectfield.db.fields.MultiSelectField(
models.CharField(
blank=True,
choices=[
(1, "ASYMPTOMATIC"),
Expand Down Expand Up @@ -2052,7 +2051,7 @@ class Migration(migrations.Migration):
("kasp_empanelled", models.BooleanField(default=False)),
(
"features",
multiselectfield.db.fields.MultiSelectField(
models.CharField(
blank=True,
choices=[
(1, "CT Scan Facility"),
Expand Down Expand Up @@ -2402,7 +2401,7 @@ class Migration(migrations.Migration):
),
(
"symptoms",
multiselectfield.db.fields.MultiSelectField(
models.CharField(
blank=True,
choices=[
(1, "ASYMPTOMATIC"),
Expand Down Expand Up @@ -4330,7 +4329,7 @@ class Migration(migrations.Migration):
),
(
"symptoms",
multiselectfield.db.fields.MultiSelectField(
models.CharField(
choices=[
(1, "ASYMPTOMATIC"),
(2, "FEVER"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Generated by Django 4.2.5 on 2024-01-08 17:26

import multiselectfield.db.fields
from django.db import migrations
from django.db import migrations, models


class Migration(migrations.Migration):
Expand All @@ -13,7 +12,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="dailyround",
name="additional_symptoms",
field=multiselectfield.db.fields.MultiSelectField(
field=models.CharField(
blank=True,
choices=[
(1, "ASYMPTOMATIC"),
Expand Down Expand Up @@ -58,7 +57,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="patientconsultation",
name="symptoms",
field=multiselectfield.db.fields.MultiSelectField(
field=models.CharField(
blank=True,
choices=[
(1, "ASYMPTOMATIC"),
Expand Down Expand Up @@ -103,7 +102,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="patientteleconsultation",
name="symptoms",
field=multiselectfield.db.fields.MultiSelectField(
field=models.CharField(
choices=[
(1, "ASYMPTOMATIC"),
(2, "FEVER"),
Expand Down
17 changes: 17 additions & 0 deletions care/facility/migrations/0455_remove_facility_old_features.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.2.15 on 2024-09-11 13:32

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("facility", "0454_remove_historicalpatientregistration_abha_number_and_more"),
]

operations = [
migrations.RemoveField(
model_name="facility",
name="old_features",
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import django.core.validators
import django.db.models.deletion
import multiselectfield.db.fields
from django.conf import settings
from django.db import migrations, models

Expand All @@ -28,7 +27,7 @@ class Migration(migrations.Migration):
),
(
"symptoms",
multiselectfield.db.fields.MultiSelectField(
models.CharField(
choices=[
(1, "NO"),
(2, "FEVER"),
Expand Down Expand Up @@ -94,7 +93,7 @@ class Migration(migrations.Migration):
),
(
"medical_history",
multiselectfield.db.fields.MultiSelectField(
models.CharField(
choices=[
(1, "NO"),
(2, "Diabetes"),
Expand Down
5 changes: 2 additions & 3 deletions care/facility/migrations_old/0068_auto_20200402_2149.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Generated by Django 2.2.11 on 2020-04-02 21:49

import multiselectfield.db.fields
from django.db import migrations, models


Expand Down Expand Up @@ -49,7 +48,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name="patientconsultation",
name="symptoms",
field=multiselectfield.db.fields.MultiSelectField(
field=models.CharField(
choices=[
(1, "ASYMPTOMATIC"),
(2, "FEVER"),
Expand All @@ -73,7 +72,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="patientteleconsultation",
name="symptoms",
field=multiselectfield.db.fields.MultiSelectField(
field=models.CharField(
choices=[
(1, "ASYMPTOMATIC"),
(2, "FEVER"),
Expand Down
5 changes: 2 additions & 3 deletions care/facility/migrations_old/0069_auto_20200402_2209.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Generated by Django 2.2.11 on 2020-04-02 22:09

import multiselectfield.db.fields
from django.db import migrations
from django.db import migrations, models


class Migration(migrations.Migration):
Expand All @@ -13,7 +12,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="patientconsultation",
name="symptoms",
field=multiselectfield.db.fields.MultiSelectField(
field=models.CharField(
blank=True,
choices=[
(1, "ASYMPTOMATIC"),
Expand Down
3 changes: 1 addition & 2 deletions care/facility/migrations_old/0074_auto_20200404_2352.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Generated by Django 2.2.11 on 2020-04-04 18:22

import multiselectfield.db.fields
from django.db import migrations, models


Expand All @@ -13,7 +12,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name="dailyround",
name="additional_symptoms",
field=multiselectfield.db.fields.MultiSelectField(
field=models.CharField(
blank=True,
choices=[
(1, "ASYMPTOMATIC"),
Expand Down
9 changes: 4 additions & 5 deletions care/facility/migrations_old/0075_auto_20200405_1122.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Generated by Django 2.2.11 on 2020-04-05 05:52

import multiselectfield.db.fields
from django.db import migrations
from django.db import migrations, models


class Migration(migrations.Migration):
Expand All @@ -13,7 +12,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="dailyround",
name="additional_symptoms",
field=multiselectfield.db.fields.MultiSelectField(
field=models.CharField(
blank=True,
choices=[
(1, "ASYMPTOMATIC"),
Expand All @@ -35,7 +34,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="patientconsultation",
name="symptoms",
field=multiselectfield.db.fields.MultiSelectField(
field=models.CharField(
blank=True,
choices=[
(1, "ASYMPTOMATIC"),
Expand All @@ -57,7 +56,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="patientteleconsultation",
name="symptoms",
field=multiselectfield.db.fields.MultiSelectField(
field=models.CharField(
choices=[
(1, "ASYMPTOMATIC"),
(2, "FEVER"),
Expand Down
9 changes: 4 additions & 5 deletions care/facility/migrations_old/0077_auto_20200409_0422.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Generated by Django 2.2.11 on 2020-04-08 22:52

import multiselectfield.db.fields
from django.db import migrations
from django.db import migrations, models


class Migration(migrations.Migration):
Expand All @@ -13,7 +12,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="dailyround",
name="additional_symptoms",
field=multiselectfield.db.fields.MultiSelectField(
field=models.CharField(
blank=True,
choices=[
(1, "ASYMPTOMATIC"),
Expand Down Expand Up @@ -41,7 +40,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="patientconsultation",
name="symptoms",
field=multiselectfield.db.fields.MultiSelectField(
field=models.CharField(
blank=True,
choices=[
(1, "ASYMPTOMATIC"),
Expand Down Expand Up @@ -69,7 +68,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="patientteleconsultation",
name="symptoms",
field=multiselectfield.db.fields.MultiSelectField(
field=models.CharField(
choices=[
(1, "ASYMPTOMATIC"),
(2, "FEVER"),
Expand Down
5 changes: 2 additions & 3 deletions care/facility/migrations_old/0298_facility_features.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Generated by Django 2.2.11 on 2022-06-22 13:06

import multiselectfield.db.fields
from django.db import migrations
from django.db import migrations, models


class Migration(migrations.Migration):
Expand All @@ -13,7 +12,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name="facility",
name="features",
field=multiselectfield.db.fields.MultiSelectField(
field=models.CharField(
blank=True,
choices=[
(1, "CT Scan Facility"),
Expand Down
5 changes: 2 additions & 3 deletions care/facility/migrations_old/0313_auto_20220901_2213.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Generated by Django 2.2.11 on 2022-09-01 16:43

import multiselectfield.db.fields
from django.db import migrations
from django.db import migrations, models


class Migration(migrations.Migration):
Expand All @@ -13,7 +12,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="facility",
name="features",
field=multiselectfield.db.fields.MultiSelectField(
field=models.CharField(
blank=True,
choices=[
(1, "CT Scan Facility"),
Expand Down
9 changes: 4 additions & 5 deletions care/facility/migrations_old/0335_auto_20230207_1914.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Generated by Django 2.2.11 on 2023-02-07 13:44

import multiselectfield.db.fields
from django.db import migrations
from django.db import migrations, models


class Migration(migrations.Migration):
Expand All @@ -13,7 +12,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="dailyround",
name="additional_symptoms",
field=multiselectfield.db.fields.MultiSelectField(
field=models.CharField(
blank=True,
choices=[
(1, "ASYMPTOMATIC"),
Expand Down Expand Up @@ -48,7 +47,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="patientconsultation",
name="symptoms",
field=multiselectfield.db.fields.MultiSelectField(
field=models.CharField(
blank=True,
choices=[
(1, "ASYMPTOMATIC"),
Expand Down Expand Up @@ -83,7 +82,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="patientteleconsultation",
name="symptoms",
field=multiselectfield.db.fields.MultiSelectField(
field=models.CharField(
choices=[
(1, "ASYMPTOMATIC"),
(2, "FEVER"),
Expand Down
8 changes: 0 additions & 8 deletions care/facility/models/facility.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
from django.contrib.postgres.fields import ArrayField
from django.core.validators import MinValueValidator
from django.db import models
from multiselectfield import MultiSelectField
from multiselectfield.utils import get_max_length
from simple_history.models import HistoricalRecords

from care.facility.models import FacilityBaseModel, reverse_choices
Expand Down Expand Up @@ -194,12 +192,6 @@ class Facility(FacilityBaseModel, FacilityPermissionMixin):
blank=True,
null=True,
)
old_features = MultiSelectField(
choices=FEATURE_CHOICES,
null=True,
blank=True,
max_length=get_max_length(FEATURE_CHOICES, None),
)
longitude = models.DecimalField(
max_digits=22, decimal_places=16, null=True, blank=True
)
Expand Down
Loading

0 comments on commit 473a648

Please sign in to comment.