Moved the make_txn_form_from_model utility to the from_model method in the TransactionForm in the accounting application.

This commit is contained in:
依瑪貓
2020-08-19 13:43:27 +08:00
parent 6f019d23c0
commit 790e8da908
3 changed files with 42 additions and 44 deletions

View File

@ -827,7 +827,7 @@ class TransactionFormView(FormView):
def make_form_from_model(self, obj: Transaction) -> TransactionForm:
"""Creates and returns the form from a data model."""
return utils.make_txn_form_from_model(self.txn_type, obj)
return TransactionForm.from_model(obj, self.txn_type)
def fill_model_from_form(self, obj: Transaction,
form: TransactionForm) -> None: