Simplified the parent constructor calls in the data models and the forms.

This commit is contained in:
依瑪貓 2020-08-12 15:39:07 +08:00
parent 2ed7c52475
commit 5e8e8e815e
3 changed files with 5 additions and 5 deletions

View File

@ -327,7 +327,7 @@ class AccountForm(forms.Form):
}) })
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(AccountForm, self).__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self.account = None self.account = None
@property @property

View File

@ -51,7 +51,7 @@ class Account(DirtyFieldsMixin, models.Model):
NET_CHANGE = "3353" NET_CHANGE = "3353"
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(Account, self).__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self.url = None self.url = None
self.debit_amount = None self.debit_amount = None
self.credit_amount = None self.credit_amount = None
@ -148,7 +148,7 @@ class Transaction(DirtyFieldsMixin, models.Model):
related_name="updated_accounting_transactions") related_name="updated_accounting_transactions")
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(Transaction, self).__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self._records = None self._records = None
self._is_balanced = None self._is_balanced = None
self._has_order_hole = None self._has_order_hole = None
@ -375,7 +375,7 @@ class Record(DirtyFieldsMixin, models.Model):
related_name="updated_accounting_records") related_name="updated_accounting_records")
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(Record, self).__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self._debit_amount = None self._debit_amount = None
self._credit_amount = None self._credit_amount = None
self.balance = None self.balance = None

View File

@ -50,7 +50,7 @@ class UserForm(forms.Form):
is_disabled = forms.BooleanField(required=False) is_disabled = forms.BooleanField(required=False)
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(UserForm, self).__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self.user = None self.user = None
self.current_user = None self.current_user = None