Skip to content

Commit

Permalink
Fix: Add purpose column to be displayed in django admin panel
Browse files Browse the repository at this point in the history
Signed-off-by: George J Padayatti <george.padayatti@igrant.io>
  • Loading branch information
georgepadayatti committed Apr 9, 2024
1 parent f09374b commit 08bfef2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion data_disclosure_agreement/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


class DataDisclosureAgreementAdmin(admin.ModelAdmin):
list_display = ('templateId', 'status', 'createdAt', 'isLatestVersion')
list_display = ('templateId', 'purpose', 'status', 'createdAt', 'isLatestVersion')

def get_list_display(self, request):
return self.list_display
Expand Down
4 changes: 4 additions & 0 deletions data_disclosure_agreement/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ class Meta:
createdAt = models.DateTimeField(auto_now_add=True)
isLatestVersion = models.BooleanField(default=True)

@property
def purpose(self):
return f"{self.dataDisclosureAgreementRecord.get('purpose', None)}"

@staticmethod
def list_by_data_source_id(
data_source_id: str, **kwargs
Expand Down

0 comments on commit 08bfef2

Please sign in to comment.