From 7dc754174ca12645932c048a113cd398f835985e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Fri, 3 Feb 2023 09:26:11 +0800 Subject: [PATCH] Revised the documentation of the views. --- src/accounting/account/views.py | 11 ++++++++--- src/accounting/base_account/views.py | 3 ++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/accounting/account/views.py b/src/accounting/account/views.py index d7538b5..942c20d 100644 --- a/src/accounting/account/views.py +++ b/src/accounting/account/views.py @@ -95,7 +95,8 @@ def add_account() -> redirect: def show_account_detail(account: Account) -> str: """Shows the account detail. - :return: The account detail. + :param account: The account. + :return: The detail. """ return render_template("accounting/account/detail.html", obj=account) @@ -105,7 +106,8 @@ def show_account_detail(account: Account) -> str: def show_account_edit_form(account: Account) -> str: """Shows the form to edit an account. - :return: The form to edit an account. + :param account: The account. + :return: The form to edit the account. """ form: AccountForm if "form" in session: @@ -123,6 +125,7 @@ def show_account_edit_form(account: Account) -> str: def update_account(account: Account) -> redirect: """Updates an account. + :param account: The account. :return: The redirection to the account detail on success, or the account edit form on error. """ @@ -152,6 +155,7 @@ def update_account(account: Account) -> redirect: def delete_account(account: Account) -> redirect: """Deletes an account. + :param account: The account. :return: The redirection to the account list on success, or the account detail on error. """ @@ -182,7 +186,8 @@ def sort_accounts(base: BaseAccount) -> redirect: """Sorts the accounts under a base account. :param base: The base account. - :return: Sorts the accounts under the base account. + :return: The redirection to the incoming account or the account list. The + sorting operation does not fail. """ form: AccountSortForm = AccountSortForm(base) form.save_order() diff --git a/src/accounting/base_account/views.py b/src/accounting/base_account/views.py index 15e3872..032b9ab 100644 --- a/src/accounting/base_account/views.py +++ b/src/accounting/base_account/views.py @@ -46,7 +46,8 @@ def list_accounts() -> str: def show_account_detail(account: BaseAccount) -> str: """Shows the account detail. - :return: The account detail. + :param account: The account. + :return: The detail. """ return render_template("accounting/base-account/detail.html", obj=account)