From 5a91e85c8e99c560e122a5c42813490a74a7ad47 Mon Sep 17 00:00:00 2001 From: imacat Date: Thu, 13 Aug 2020 22:15:54 +0800 Subject: [PATCH] Added the get_absolute_url() method to the account data model in the accounting application. --- accounting/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/accounting/models.py b/accounting/models.py index 091f4b8..30c7bd2 100644 --- a/accounting/models.py +++ b/accounting/models.py @@ -82,6 +82,10 @@ class Account(DirtyFieldsMixin, models.Model): super().save(force_insert=force_insert, force_update=force_update, using=using, update_fields=update_fields) + def get_absolute_url(self): + """REturns the """ + return reverse("accounting:accounts.detail", args=(self,)) + class Meta: db_table = "accounting_accounts"