Skip to content

Commit

Permalink
Add is_archived field to FileUpload (#1052)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashesh3 authored Oct 4, 2022
1 parent 47250fe commit e7052a9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
4 changes: 3 additions & 1 deletion care/facility/api/serializers/file_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class Meta:
"name",
"uploaded_by",
"upload_completed",
"is_archived",
"created_date",
"file_category",
"extension",
Expand All @@ -129,7 +130,7 @@ class FileUploadUpdateSerializer(serializers.ModelSerializer):

class Meta:
model = FileUpload
fields = ("id", "name", "upload_completed")
fields = ("id", "name", "upload_completed", "is_archived")


class FileUploadRetrieveSerializer(serializers.ModelSerializer):
Expand All @@ -146,6 +147,7 @@ class Meta:
"name",
"uploaded_by",
"upload_completed",
"is_archived",
"created_date",
"read_signed_url",
"file_category",
Expand Down
18 changes: 18 additions & 0 deletions care/facility/migrations/0322_fileupload_is_archived.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.11 on 2022-10-04 08:30

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('facility', '0321_merge_20220921_2255'),
]

operations = [
migrations.AddField(
model_name='fileupload',
name='is_archived',
field=models.BooleanField(default=False),
),
]
1 change: 1 addition & 0 deletions care/facility/models/file_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class FileCategory(enum.Enum):
internal_name = models.CharField(max_length=2000)
associating_id = models.CharField(max_length=100, blank=False, null=False)
upload_completed = models.BooleanField(default=False)
is_archived = models.BooleanField(default=False)
uploaded_by = models.ForeignKey(
User, on_delete=models.PROTECT, null=True, blank=True
)
Expand Down

0 comments on commit e7052a9

Please sign in to comment.