Skip to content

Commit

Permalink
Added a modified_date
Browse files Browse the repository at this point in the history
Fixes ohcnetwork#2085
Took inspiration from field ``doctor_experience_commenced_on`` on how to create a new field in the codespace
Used ``python manage.py makemigrations`` and ''python manage.py migrate'' to create new field in the database table
  • Loading branch information
JohnLu2004 authored and JohnLu2004 committed Dec 3, 2024
1 parent 907e87a commit a331bec
Show file tree
Hide file tree
Showing 4 changed files with 957 additions and 929 deletions.
4 changes: 4 additions & 0 deletions care/users/api/serializers/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Meta:
"user_type",
"qualification",
"doctor_experience_commenced_on",
"modified_date",
"doctor_medical_council_registration",
"ward",
"local_body",
Expand Down Expand Up @@ -313,6 +314,7 @@ class Meta:
"user_type",
"qualification",
"doctor_experience_commenced_on",
"modified_date",
"doctor_medical_council_registration",
"created_by",
"home_facility",
Expand Down Expand Up @@ -414,6 +416,7 @@ class Meta:
"home_facility_object",
"qualification",
"doctor_experience_commenced_on",
"modified_date",
"video_connect_link",
"doctor_medical_council_registration",
"skills",
Expand Down Expand Up @@ -447,6 +450,7 @@ class Meta:
"user_type",
"qualification",
"doctor_experience_commenced_on",
"modified_date",
"doctor_medical_council_registration",
"weekly_working_hours",
"created_by",
Expand Down
18 changes: 18 additions & 0 deletions care/users/migrations/0021_user_modified_date.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.1.3 on 2024-12-03 03:38

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('users', '0020_plugconfig'),
]

operations = [
migrations.AddField(
model_name='user',
name='modified_date',
field=models.DateTimeField(default=None, null=True),
),
]
5 changes: 5 additions & 0 deletions care/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ class User(AbstractUser):
blank=False,
null=True,
)
modified_date = models.DateTimeField(
default=None,
blank=False,
null=True,
)
doctor_medical_council_registration = models.CharField(
max_length=255,
default=None,
Expand Down
Loading

0 comments on commit a331bec

Please sign in to comment.