From 5d1f87582e1209ad0e5c770217ee0e5a29409851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Thu, 9 Mar 2023 18:09:08 +0800 Subject: [PATCH] Moved the "accounting.report.reports.utils" module to "accounting.report.utils". It does not make sense to have a wierd and long module name just to make the import pretty. --- src/accounting/report/reports/balance_sheet.py | 18 ++++++++++-------- .../report/reports/income_expenses.py | 17 +++++++++-------- .../report/reports/income_statement.py | 17 +++++++++-------- src/accounting/report/reports/journal.py | 15 ++++++++------- src/accounting/report/reports/ledger.py | 17 +++++++++-------- src/accounting/report/reports/search.py | 10 +++++----- src/accounting/report/reports/trial_balance.py | 17 +++++++++-------- .../report/{reports => }/utils/__init__.py | 2 +- .../{reports => }/utils/base_page_params.py | 0 .../report/{reports => }/utils/base_report.py | 0 .../report/{reports => }/utils/csv_export.py | 0 .../report/{reports => }/utils/option_link.py | 0 .../{reports => }/utils/period_choosers.py | 0 .../{reports => }/utils/report_chooser.py | 0 .../report/{reports => }/utils/report_type.py | 0 .../report/{reports => }/utils/urls.py | 0 16 files changed, 60 insertions(+), 53 deletions(-) rename src/accounting/report/{reports => }/utils/__init__.py (94%) rename src/accounting/report/{reports => }/utils/base_page_params.py (100%) rename src/accounting/report/{reports => }/utils/base_report.py (100%) rename src/accounting/report/{reports => }/utils/csv_export.py (100%) rename src/accounting/report/{reports => }/utils/option_link.py (100%) rename src/accounting/report/{reports => }/utils/period_choosers.py (100%) rename src/accounting/report/{reports => }/utils/report_chooser.py (100%) rename src/accounting/report/{reports => }/utils/report_type.py (100%) rename src/accounting/report/{reports => }/utils/urls.py (100%) diff --git a/src/accounting/report/reports/balance_sheet.py b/src/accounting/report/reports/balance_sheet.py index 6d3c5e2..abcd662 100644 --- a/src/accounting/report/reports/balance_sheet.py +++ b/src/accounting/report/reports/balance_sheet.py @@ -27,14 +27,16 @@ from accounting.locale import gettext from accounting.models import Currency, BaseAccount, Account, Transaction, \ JournalEntry from accounting.report.period import Period -from .utils.base_page_params import BasePageParams -from .utils.base_report import BaseReport -from .utils.csv_export import BaseCSVRow, csv_download, period_spec -from .utils.option_link import OptionLink -from .utils.period_choosers import PeriodChooser -from .utils.report_chooser import ReportChooser -from .utils.report_type import ReportType -from .utils.urls import ledger_url, balance_sheet_url, income_statement_url +from accounting.report.utils.base_page_params import BasePageParams +from accounting.report.utils.base_report import BaseReport +from accounting.report.utils.csv_export import BaseCSVRow, csv_download, \ + period_spec +from accounting.report.utils.option_link import OptionLink +from accounting.report.utils.period_choosers import PeriodChooser +from accounting.report.utils.report_chooser import ReportChooser +from accounting.report.utils.report_type import ReportType +from accounting.report.utils.urls import ledger_url, balance_sheet_url, \ + income_statement_url class ReportAccount: diff --git a/src/accounting/report/reports/income_expenses.py b/src/accounting/report/reports/income_expenses.py index 2e1006c..e0ac3e1 100644 --- a/src/accounting/report/reports/income_expenses.py +++ b/src/accounting/report/reports/income_expenses.py @@ -29,15 +29,16 @@ from accounting.locale import gettext from accounting.models import Currency, Account, Transaction, JournalEntry from accounting.report.income_expense_account import IncomeExpensesAccount from accounting.report.period import Period +from accounting.report.utils.base_page_params import BasePageParams +from accounting.report.utils.base_report import BaseReport +from accounting.report.utils.csv_export import BaseCSVRow, csv_download, \ + period_spec +from accounting.report.utils.option_link import OptionLink +from accounting.report.utils.period_choosers import PeriodChooser +from accounting.report.utils.report_chooser import ReportChooser +from accounting.report.utils.report_type import ReportType +from accounting.report.utils.urls import income_expenses_url from accounting.utils.pagination import Pagination -from .utils.base_page_params import BasePageParams -from .utils.base_report import BaseReport -from .utils.csv_export import BaseCSVRow, csv_download, period_spec -from .utils.option_link import OptionLink -from .utils.period_choosers import PeriodChooser -from .utils.report_chooser import ReportChooser -from .utils.report_type import ReportType -from .utils.urls import income_expenses_url class ReportEntry: diff --git a/src/accounting/report/reports/income_statement.py b/src/accounting/report/reports/income_statement.py index fa640d9..5dc890b 100644 --- a/src/accounting/report/reports/income_statement.py +++ b/src/accounting/report/reports/income_statement.py @@ -27,14 +27,15 @@ from accounting.locale import gettext from accounting.models import Currency, BaseAccount, Account, Transaction, \ JournalEntry from accounting.report.period import Period -from .utils.base_page_params import BasePageParams -from .utils.base_report import BaseReport -from .utils.csv_export import BaseCSVRow, csv_download, period_spec -from .utils.option_link import OptionLink -from .utils.period_choosers import PeriodChooser -from .utils.report_chooser import ReportChooser -from .utils.report_type import ReportType -from .utils.urls import ledger_url, income_statement_url +from accounting.report.utils.base_page_params import BasePageParams +from accounting.report.utils.base_report import BaseReport +from accounting.report.utils.csv_export import BaseCSVRow, csv_download, \ + period_spec +from accounting.report.utils.option_link import OptionLink +from accounting.report.utils.period_choosers import PeriodChooser +from accounting.report.utils.report_chooser import ReportChooser +from accounting.report.utils.report_type import ReportType +from accounting.report.utils.urls import ledger_url, income_statement_url class ReportAccount: diff --git a/src/accounting/report/reports/journal.py b/src/accounting/report/reports/journal.py index 5d26fa9..94ff1b6 100644 --- a/src/accounting/report/reports/journal.py +++ b/src/accounting/report/reports/journal.py @@ -27,14 +27,15 @@ from sqlalchemy.orm import selectinload from accounting.locale import gettext from accounting.models import Currency, Account, Transaction, JournalEntry from accounting.report.period import Period +from accounting.report.utils.base_page_params import BasePageParams +from accounting.report.utils.base_report import BaseReport +from accounting.report.utils.csv_export import BaseCSVRow, csv_download, \ + period_spec +from accounting.report.utils.period_choosers import PeriodChooser +from accounting.report.utils.report_chooser import ReportChooser +from accounting.report.utils.report_type import ReportType +from accounting.report.utils.urls import journal_url from accounting.utils.pagination import Pagination -from .utils.base_page_params import BasePageParams -from .utils.base_report import BaseReport -from .utils.csv_export import BaseCSVRow, csv_download, period_spec -from .utils.period_choosers import PeriodChooser -from .utils.report_chooser import ReportChooser -from .utils.report_type import ReportType -from .utils.urls import journal_url class ReportEntry: diff --git a/src/accounting/report/reports/ledger.py b/src/accounting/report/reports/ledger.py index f40a9da..b449bd0 100644 --- a/src/accounting/report/reports/ledger.py +++ b/src/accounting/report/reports/ledger.py @@ -28,15 +28,16 @@ from accounting import db from accounting.locale import gettext from accounting.models import Currency, Account, Transaction, JournalEntry from accounting.report.period import Period +from accounting.report.utils.base_page_params import BasePageParams +from accounting.report.utils.base_report import BaseReport +from accounting.report.utils.csv_export import BaseCSVRow, csv_download, \ + period_spec +from accounting.report.utils.option_link import OptionLink +from accounting.report.utils.period_choosers import PeriodChooser +from accounting.report.utils.report_chooser import ReportChooser +from accounting.report.utils.report_type import ReportType +from accounting.report.utils.urls import ledger_url from accounting.utils.pagination import Pagination -from .utils.base_page_params import BasePageParams -from .utils.base_report import BaseReport -from .utils.csv_export import BaseCSVRow, csv_download, period_spec -from .utils.option_link import OptionLink -from .utils.period_choosers import PeriodChooser -from .utils.report_chooser import ReportChooser -from .utils.report_type import ReportType -from .utils.urls import ledger_url class ReportEntry: diff --git a/src/accounting/report/reports/search.py b/src/accounting/report/reports/search.py index edb87bb..ddef409 100644 --- a/src/accounting/report/reports/search.py +++ b/src/accounting/report/reports/search.py @@ -27,14 +27,14 @@ from sqlalchemy.orm import selectinload from accounting.locale import gettext from accounting.models import Currency, CurrencyL10n, Account, AccountL10n, \ Transaction, JournalEntry +from accounting.report.utils.base_page_params import BasePageParams +from accounting.report.utils.base_report import BaseReport +from accounting.report.utils.csv_export import csv_download +from accounting.report.utils.report_chooser import ReportChooser +from accounting.report.utils.report_type import ReportType from accounting.utils.pagination import Pagination from accounting.utils.query import parse_query_keywords from .journal import get_csv_rows -from .utils.base_page_params import BasePageParams -from .utils.base_report import BaseReport -from .utils.csv_export import csv_download -from .utils.report_chooser import ReportChooser -from .utils.report_type import ReportType class EntryCollector: diff --git a/src/accounting/report/reports/trial_balance.py b/src/accounting/report/reports/trial_balance.py index d566f12..b7adc32 100644 --- a/src/accounting/report/reports/trial_balance.py +++ b/src/accounting/report/reports/trial_balance.py @@ -26,14 +26,15 @@ from accounting import db from accounting.locale import gettext from accounting.models import Currency, Account, Transaction, JournalEntry from accounting.report.period import Period -from .utils.base_page_params import BasePageParams -from .utils.base_report import BaseReport -from .utils.csv_export import BaseCSVRow, csv_download, period_spec -from .utils.option_link import OptionLink -from .utils.period_choosers import PeriodChooser -from .utils.report_chooser import ReportChooser -from .utils.report_type import ReportType -from .utils.urls import ledger_url, trial_balance_url +from accounting.report.utils.base_page_params import BasePageParams +from accounting.report.utils.base_report import BaseReport +from accounting.report.utils.csv_export import BaseCSVRow, csv_download, \ + period_spec +from accounting.report.utils.option_link import OptionLink +from accounting.report.utils.period_choosers import PeriodChooser +from accounting.report.utils.report_chooser import ReportChooser +from accounting.report.utils.report_type import ReportType +from accounting.report.utils.urls import ledger_url, trial_balance_url class ReportAccount: diff --git a/src/accounting/report/reports/utils/__init__.py b/src/accounting/report/utils/__init__.py similarity index 94% rename from src/accounting/report/reports/utils/__init__.py rename to src/accounting/report/utils/__init__.py index 32409a5..27a7dc0 100644 --- a/src/accounting/report/reports/utils/__init__.py +++ b/src/accounting/report/utils/__init__.py @@ -14,6 +14,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -"""The utilities to generate reports. +"""The utilities for the reports. """ diff --git a/src/accounting/report/reports/utils/base_page_params.py b/src/accounting/report/utils/base_page_params.py similarity index 100% rename from src/accounting/report/reports/utils/base_page_params.py rename to src/accounting/report/utils/base_page_params.py diff --git a/src/accounting/report/reports/utils/base_report.py b/src/accounting/report/utils/base_report.py similarity index 100% rename from src/accounting/report/reports/utils/base_report.py rename to src/accounting/report/utils/base_report.py diff --git a/src/accounting/report/reports/utils/csv_export.py b/src/accounting/report/utils/csv_export.py similarity index 100% rename from src/accounting/report/reports/utils/csv_export.py rename to src/accounting/report/utils/csv_export.py diff --git a/src/accounting/report/reports/utils/option_link.py b/src/accounting/report/utils/option_link.py similarity index 100% rename from src/accounting/report/reports/utils/option_link.py rename to src/accounting/report/utils/option_link.py diff --git a/src/accounting/report/reports/utils/period_choosers.py b/src/accounting/report/utils/period_choosers.py similarity index 100% rename from src/accounting/report/reports/utils/period_choosers.py rename to src/accounting/report/utils/period_choosers.py diff --git a/src/accounting/report/reports/utils/report_chooser.py b/src/accounting/report/utils/report_chooser.py similarity index 100% rename from src/accounting/report/reports/utils/report_chooser.py rename to src/accounting/report/utils/report_chooser.py diff --git a/src/accounting/report/reports/utils/report_type.py b/src/accounting/report/utils/report_type.py similarity index 100% rename from src/accounting/report/reports/utils/report_type.py rename to src/accounting/report/utils/report_type.py diff --git a/src/accounting/report/reports/utils/urls.py b/src/accounting/report/utils/urls.py similarity index 100% rename from src/accounting/report/reports/utils/urls.py rename to src/accounting/report/utils/urls.py