Revised the way to import from the datetime package, to avoid name conflict with the common "date" and "time" names.

This commit is contained in:
2023-04-26 13:17:31 +08:00
parent c11ae23885
commit 359c335662
30 changed files with 156 additions and 152 deletions

View File

@ -17,7 +17,7 @@
"""The reorder forms for the journal entry management.
"""
from datetime import date
import datetime as dt
import sqlalchemy as sa
from flask import request
@ -26,7 +26,7 @@ from accounting import db
from accounting.models import JournalEntry
def sort_journal_entries_in(journal_entry_date: date,
def sort_journal_entries_in(journal_entry_date: dt.date,
exclude: int | None = None) -> None:
"""Sorts the journal entries under a date after changing the date or
deleting a journal entry.
@ -50,12 +50,12 @@ def sort_journal_entries_in(journal_entry_date: date,
class JournalEntryReorderForm:
"""The form to reorder the journal entries."""
def __init__(self, journal_entry_date: date):
def __init__(self, journal_entry_date: dt.date):
"""Constructs the form to reorder the journal entries in a day.
:param journal_entry_date: The date.
"""
self.date: date = journal_entry_date
self.date: dt.date = journal_entry_date
self.is_modified: bool = False
def save_order(self) -> None: