Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
7086c26ce7 | |||
2ec072854b | |||
a41d381322 | |||
c301f7ca74 | |||
020555602d | |||
9176be3c11 | |||
1d16b250d8 | |||
72b9555e29 | |||
d09255432d | |||
64e81a64ef | |||
e14a0432b2 | |||
7e7d428b52 | |||
353ebd7242 | |||
467739e0c8 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,6 +1,7 @@
|
|||||||
*.pyc
|
*.pyc
|
||||||
__pycache__
|
__pycache__
|
||||||
dist
|
dist
|
||||||
|
build
|
||||||
*.egg-info
|
*.egg-info
|
||||||
migrations
|
migrations
|
||||||
*.mo
|
*.mo
|
||||||
|
50
README.rst
50
README.rst
@ -1,8 +1,38 @@
|
|||||||
======================================
|
======================================
|
||||||
The Mia! Django Accounting Application
|
The Mia! Accounting Django Application
|
||||||
======================================
|
======================================
|
||||||
|
|
||||||
|
|
||||||
|
Obsolete Project
|
||||||
|
================
|
||||||
|
|
||||||
|
This project is obsolete. No further Django release will be
|
||||||
|
available. Check the current `Mia! Accounting project`_ for Flask_,
|
||||||
|
and the current `Mia! Accounting live demonstration`_.
|
||||||
|
|
||||||
|
.. _Mia! Accounting project: https://github.com/imacat/mia-accounting
|
||||||
|
.. _Flask: https://flask.palletsprojects.com
|
||||||
|
.. _Mia! Accounting live demonstration: https://accounting.imacat.idv.tw
|
||||||
|
|
||||||
|
|
||||||
|
Warning
|
||||||
|
=======
|
||||||
|
|
||||||
|
|
||||||
|
This is the last release of Django. It will be replaced by a new
|
||||||
|
Flask_ release, starting from scratch. Do not upgrade to the next
|
||||||
|
release, as it will not work.
|
||||||
|
|
||||||
|
This was my first large Python project, and at that time, I had zero
|
||||||
|
experience with Django. I ended up in a mess with Django MVT. The
|
||||||
|
code is unnecessarily complicated, and I do not actually know how the
|
||||||
|
views work anymore.
|
||||||
|
|
||||||
|
If you are new to the Mia! Accounting project, please skip this and
|
||||||
|
try the new release. You may contact me if you have problems with
|
||||||
|
the existing installation, but I may not be able to help you.
|
||||||
|
|
||||||
|
|
||||||
Description
|
Description
|
||||||
===========
|
===========
|
||||||
|
|
||||||
@ -13,7 +43,7 @@ a modern back-end framework and front-end technology like jQuery. The
|
|||||||
first revision was in Perl/Mojolicious_ in 2019. This is the second
|
first revision was in Perl/Mojolicious_ in 2019. This is the second
|
||||||
revision in Python/Django in 2020.
|
revision in Python/Django in 2020.
|
||||||
|
|
||||||
The Mia! Django accounting application comes with two parts:
|
The Mia! Accounting Django application comes with two parts:
|
||||||
|
|
||||||
- The ``accounting`` application contains the main accounting
|
- The ``accounting`` application contains the main accounting
|
||||||
application.
|
application.
|
||||||
@ -23,7 +53,7 @@ The Mia! Django accounting application comes with two parts:
|
|||||||
|
|
||||||
You may try it in live demonstration at:
|
You may try it in live demonstration at:
|
||||||
|
|
||||||
- URL: https://accounting.imacat.idv.tw/accounting
|
- URL: https://accounting-django.imacat.idv.tw/accounting
|
||||||
- Username: ``admin``
|
- Username: ``admin``
|
||||||
- Password: ``12345``
|
- Password: ``12345``
|
||||||
|
|
||||||
@ -38,14 +68,14 @@ Installation
|
|||||||
Install
|
Install
|
||||||
-------
|
-------
|
||||||
|
|
||||||
The Mia! Django accounting application requires Python 3.7 and Django
|
The Mia! Accounting Django application requires Python 3.7 and Django
|
||||||
3.1.
|
3.1.
|
||||||
|
|
||||||
Install ``mia-accounting`` with ``pip``.
|
Install ``mia-accounting-django`` with ``pip``.
|
||||||
|
|
||||||
.. code::
|
.. code::
|
||||||
|
|
||||||
pip install mia-accounting
|
pip install mia-accounting-django
|
||||||
|
|
||||||
``settings.py``
|
``settings.py``
|
||||||
---------------
|
---------------
|
||||||
@ -147,7 +177,7 @@ And you are done.
|
|||||||
Management Commands
|
Management Commands
|
||||||
===================
|
===================
|
||||||
|
|
||||||
The following management commands are added by *the Mia! accounting
|
The following management commands are added by *the Mia! Accounting Django
|
||||||
application* to ``manage.py``:
|
application* to ``manage.py``:
|
||||||
|
|
||||||
``accounting_accounts``
|
``accounting_accounts``
|
||||||
@ -283,9 +313,9 @@ The following advanced settings are available in ``settings.py``.
|
|||||||
Bugs and Supports
|
Bugs and Supports
|
||||||
=================
|
=================
|
||||||
|
|
||||||
The Mia! Django accounting application is hosted on GitHub.
|
The Mia! Accounting Django application is hosted on GitHub.
|
||||||
|
|
||||||
https://github.com/imacat/mia-accounting
|
https://github.com/imacat/mia-accounting-django
|
||||||
|
|
||||||
Address all bugs and support requests to imacat@mail.imacat.idv.tw.
|
Address all bugs and support requests to imacat@mail.imacat.idv.tw.
|
||||||
|
|
||||||
@ -293,7 +323,7 @@ Address all bugs and support requests to imacat@mail.imacat.idv.tw.
|
|||||||
Copyright
|
Copyright
|
||||||
=========
|
=========
|
||||||
|
|
||||||
Copyright (c) 2020-2021 imacat.
|
Copyright (c) 2020-2023 imacat.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
20
docs/Makefile
Normal file
20
docs/Makefile
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Minimal makefile for Sphinx documentation
|
||||||
|
#
|
||||||
|
|
||||||
|
# You can set these variables from the command line, and also
|
||||||
|
# from the environment for the first two.
|
||||||
|
SPHINXOPTS ?=
|
||||||
|
SPHINXBUILD ?= sphinx-build
|
||||||
|
SOURCEDIR = source
|
||||||
|
BUILDDIR = build
|
||||||
|
|
||||||
|
# Put it first so that "make" without argument is like "make help".
|
||||||
|
help:
|
||||||
|
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||||
|
|
||||||
|
.PHONY: help Makefile
|
||||||
|
|
||||||
|
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||||
|
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||||
|
%: Makefile
|
||||||
|
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
35
docs/make.bat
Normal file
35
docs/make.bat
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
@ECHO OFF
|
||||||
|
|
||||||
|
pushd %~dp0
|
||||||
|
|
||||||
|
REM Command file for Sphinx documentation
|
||||||
|
|
||||||
|
if "%SPHINXBUILD%" == "" (
|
||||||
|
set SPHINXBUILD=sphinx-build
|
||||||
|
)
|
||||||
|
set SOURCEDIR=source
|
||||||
|
set BUILDDIR=build
|
||||||
|
|
||||||
|
%SPHINXBUILD% >NUL 2>NUL
|
||||||
|
if errorlevel 9009 (
|
||||||
|
echo.
|
||||||
|
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
||||||
|
echo.installed, then set the SPHINXBUILD environment variable to point
|
||||||
|
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
||||||
|
echo.may add the Sphinx directory to PATH.
|
||||||
|
echo.
|
||||||
|
echo.If you don't have Sphinx installed, grab it from
|
||||||
|
echo.https://www.sphinx-doc.org/
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "" goto help
|
||||||
|
|
||||||
|
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
||||||
|
goto end
|
||||||
|
|
||||||
|
:help
|
||||||
|
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
||||||
|
|
||||||
|
:end
|
||||||
|
popd
|
4
docs/requirements.txt
Normal file
4
docs/requirements.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
django
|
||||||
|
django-dirtyfields
|
||||||
|
titlecase
|
||||||
|
django-decorator-include
|
0
docs/source/_static/.keep
Normal file
0
docs/source/_static/.keep
Normal file
0
docs/source/_templates/.keep
Normal file
0
docs/source/_templates/.keep
Normal file
21
docs/source/accounting.migrations.rst
Normal file
21
docs/source/accounting.migrations.rst
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
accounting.migrations package
|
||||||
|
=============================
|
||||||
|
|
||||||
|
Submodules
|
||||||
|
----------
|
||||||
|
|
||||||
|
accounting.migrations.0001\_initial module
|
||||||
|
------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: accounting.migrations.0001_initial
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: accounting.migrations
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
94
docs/source/accounting.rst
Normal file
94
docs/source/accounting.rst
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
accounting package
|
||||||
|
==================
|
||||||
|
|
||||||
|
Subpackages
|
||||||
|
-----------
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 4
|
||||||
|
|
||||||
|
accounting.migrations
|
||||||
|
accounting.templatetags
|
||||||
|
|
||||||
|
Submodules
|
||||||
|
----------
|
||||||
|
|
||||||
|
accounting.apps module
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
.. automodule:: accounting.apps
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
accounting.converters module
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
.. automodule:: accounting.converters
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
accounting.forms module
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
.. automodule:: accounting.forms
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
accounting.models module
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
.. automodule:: accounting.models
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
accounting.tests module
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
.. automodule:: accounting.tests
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
accounting.urls module
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
.. automodule:: accounting.urls
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
accounting.utils module
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
.. automodule:: accounting.utils
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
accounting.validators module
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
.. automodule:: accounting.validators
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
accounting.views module
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
.. automodule:: accounting.views
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: accounting
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
21
docs/source/accounting.templatetags.rst
Normal file
21
docs/source/accounting.templatetags.rst
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
accounting.templatetags package
|
||||||
|
===============================
|
||||||
|
|
||||||
|
Submodules
|
||||||
|
----------
|
||||||
|
|
||||||
|
accounting.templatetags.accounting module
|
||||||
|
-----------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: accounting.templatetags.accounting
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: accounting.templatetags
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
36
docs/source/conf.py
Normal file
36
docs/source/conf.py
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# Configuration file for the Sphinx documentation builder.
|
||||||
|
#
|
||||||
|
# For the full list of built-in configuration values, see the documentation:
|
||||||
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import django
|
||||||
|
|
||||||
|
sys.path.insert(0, os.path.abspath('../../src/'))
|
||||||
|
sys.path.append(os.path.abspath('../../tests/test_site/'))
|
||||||
|
os.environ["DJANGO_SETTINGS_MODULE"] = "test_site.settings"
|
||||||
|
django.setup()
|
||||||
|
|
||||||
|
# -- Project information -----------------------------------------------------
|
||||||
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
||||||
|
|
||||||
|
project = 'Mia! Accounting Django'
|
||||||
|
copyright = '2022-2023, imacat'
|
||||||
|
author = 'imacat'
|
||||||
|
release = '0.2.0'
|
||||||
|
|
||||||
|
# -- General configuration ---------------------------------------------------
|
||||||
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
||||||
|
|
||||||
|
extensions = ["sphinx.ext.autodoc"]
|
||||||
|
|
||||||
|
templates_path = ['_templates']
|
||||||
|
exclude_patterns = []
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# -- Options for HTML output -------------------------------------------------
|
||||||
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
||||||
|
|
||||||
|
html_theme = 'sphinx_rtd_theme'
|
||||||
|
html_static_path = ['_static']
|
20
docs/source/index.rst
Normal file
20
docs/source/index.rst
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
.. Mia! Accounting Django documentation master file, created by
|
||||||
|
sphinx-quickstart on Thu Dec 8 00:42:14 2022.
|
||||||
|
You can adapt this file completely to your liking, but it should at least
|
||||||
|
contain the root `toctree` directive.
|
||||||
|
|
||||||
|
Welcome to Mia! Accounting Django's documentation!
|
||||||
|
==================================================
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
:caption: Contents:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Indices and tables
|
||||||
|
==================
|
||||||
|
|
||||||
|
* :ref:`genindex`
|
||||||
|
* :ref:`modindex`
|
||||||
|
* :ref:`search`
|
10
docs/source/mia_core.migrations.rst
Normal file
10
docs/source/mia_core.migrations.rst
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
mia\_core.migrations package
|
||||||
|
============================
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: mia_core.migrations
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
70
docs/source/mia_core.rst
Normal file
70
docs/source/mia_core.rst
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
mia\_core package
|
||||||
|
=================
|
||||||
|
|
||||||
|
Subpackages
|
||||||
|
-----------
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 4
|
||||||
|
|
||||||
|
mia_core.migrations
|
||||||
|
mia_core.templatetags
|
||||||
|
|
||||||
|
Submodules
|
||||||
|
----------
|
||||||
|
|
||||||
|
mia\_core.apps module
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
.. automodule:: mia_core.apps
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
mia\_core.models module
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
.. automodule:: mia_core.models
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
mia\_core.period module
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
.. automodule:: mia_core.period
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
mia\_core.tests module
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
.. automodule:: mia_core.tests
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
mia\_core.utils module
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
.. automodule:: mia_core.utils
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
mia\_core.views module
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
.. automodule:: mia_core.views
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: mia_core
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
21
docs/source/mia_core.templatetags.rst
Normal file
21
docs/source/mia_core.templatetags.rst
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
mia\_core.templatetags package
|
||||||
|
==============================
|
||||||
|
|
||||||
|
Submodules
|
||||||
|
----------
|
||||||
|
|
||||||
|
mia\_core.templatetags.mia\_core module
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: mia_core.templatetags.mia_core
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: mia_core.templatetags
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
8
docs/source/modules.rst
Normal file
8
docs/source/modules.rst
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
src
|
||||||
|
===
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 4
|
||||||
|
|
||||||
|
accounting
|
||||||
|
mia_core
|
10
setup.cfg
10
setup.cfg
@ -1,7 +1,7 @@
|
|||||||
# The setup.cfg
|
# The setup.cfg
|
||||||
# by imacat <imacat@mail.imacat.idv.tw>, 2020/9/7
|
# by imacat <imacat@mail.imacat.idv.tw>, 2020/9/7
|
||||||
|
|
||||||
# Copyright (c) 2020 imacat.
|
# Copyright (c) 2020-2023 imacat.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@ -17,15 +17,15 @@
|
|||||||
|
|
||||||
[metadata]
|
[metadata]
|
||||||
name = mia-accounting
|
name = mia-accounting
|
||||||
version = 0.1.0
|
version = 0.2.0
|
||||||
author = imacat
|
author = imacat
|
||||||
author_email = imacat@mail.imacat.idv.tw
|
author_email = imacat@mail.imacat.idv.tw
|
||||||
description = A Django accounting application.
|
description = The Mia! Accounting Django project.
|
||||||
long_description = file: README.rst
|
long_description = file: README.rst
|
||||||
long_description_content_type = text/x-rst
|
long_description_content_type = text/x-rst
|
||||||
url = https://github.com/imacat/mia-accounting
|
url = https://github.com/imacat/mia-accounting-django
|
||||||
project_urls =
|
project_urls =
|
||||||
Bug Tracker = https://github.com/imacat/mia-accounting/issues
|
Bug Tracker = https://github.com/imacat/mia-accounting-django/issues
|
||||||
classifiers =
|
classifiers =
|
||||||
Programming Language :: Python :: 3
|
Programming Language :: Python :: 3
|
||||||
License :: OSI Approved :: Apache Software License
|
License :: OSI Approved :: Apache Software License
|
||||||
|
@ -80,10 +80,9 @@ class ReportUrl:
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
namespace: The namespace of the current application.
|
namespace: The namespace of the current application.
|
||||||
cash: The currently-specified account of the
|
cash: The currently-specified account of the cash account or cash
|
||||||
cash account or cash summary.
|
summary.
|
||||||
ledger: The currently-specified account of the
|
ledger: The currently-specified account of the ledger or leger summary.
|
||||||
ledger or leger summary.
|
|
||||||
period: The currently-specified period.
|
period: The currently-specified period.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -145,9 +144,8 @@ class DataFiller:
|
|||||||
"""Adds accounts.
|
"""Adds accounts.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
accounts (tuple[tuple[any]]): Tuples of
|
accounts: Tuples of (code, English, Traditional Chinese, Simplified
|
||||||
(code, English, Traditional Chinese, Simplified Chinese)
|
Chinese) of the accounts.
|
||||||
of the accounts.
|
|
||||||
"""
|
"""
|
||||||
for data in accounts:
|
for data in accounts:
|
||||||
code = data[0]
|
code = data[0]
|
||||||
@ -167,8 +165,7 @@ class DataFiller:
|
|||||||
"""Adds a transfer transaction.
|
"""Adds a transfer transaction.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
date: The date, or the number of days from
|
date: The date, or the number of days from today.
|
||||||
today.
|
|
||||||
debit: Tuples of (account, summary, amount) of the debit records.
|
debit: Tuples of (account, summary, amount) of the debit records.
|
||||||
credit: Tuples of (account, summary, amount) of the credit records.
|
credit: Tuples of (account, summary, amount) of the credit records.
|
||||||
"""
|
"""
|
||||||
|
@ -429,8 +429,7 @@ class Pagination:
|
|||||||
url (str): The link URL, or for a non-link slot.
|
url (str): The link URL, or for a non-link slot.
|
||||||
title (str): The title of the link.
|
title (str): The title of the link.
|
||||||
is_active (bool): Whether this link is currently active.
|
is_active (bool): Whether this link is currently active.
|
||||||
is_small_screen (bool): Whether this link is for small
|
is_small_screen (bool): Whether this link is for small screens.
|
||||||
screens
|
|
||||||
"""
|
"""
|
||||||
def __int__(self):
|
def __int__(self):
|
||||||
self.url = None
|
self.url = None
|
||||||
|
@ -76,9 +76,13 @@ class RunTestCase(unittest.TestCase):
|
|||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
today: str = datetime.today().strftime("%Y-%m-%d")
|
today: str = datetime.today().strftime("%Y-%m-%d")
|
||||||
|
expense_add_uri: str = "/accounting/transactions/expense/create?r=/ok"
|
||||||
|
income_add_uri: str = "/accounting/transactions/income/create?r=/ok"
|
||||||
|
transfer_add_uri: str \
|
||||||
|
= "/accounting/transactions/transfer/create?r=/ok"
|
||||||
|
|
||||||
response = self.client.post(
|
response = self.client.post(
|
||||||
"/accounting/transactions/expense/create?r=/ok",
|
expense_add_uri,
|
||||||
{"date": today,
|
{"date": today,
|
||||||
"debit-2-ord": 6,
|
"debit-2-ord": 6,
|
||||||
"debit-2-summary": "lunch",
|
"debit-2-summary": "lunch",
|
||||||
@ -90,9 +94,10 @@ class RunTestCase(unittest.TestCase):
|
|||||||
"debit-8-account": "6273",
|
"debit-8-account": "6273",
|
||||||
"notes": "yammy"})
|
"notes": "yammy"})
|
||||||
self.assertEqual(response.status_code, 302)
|
self.assertEqual(response.status_code, 302)
|
||||||
|
self.assertNotEqual(response.headers["Location"], expense_add_uri)
|
||||||
|
|
||||||
response = self.client.post(
|
response = self.client.post(
|
||||||
"/accounting/transactions/income/create?r=/ok",
|
income_add_uri,
|
||||||
{"date": today,
|
{"date": today,
|
||||||
"credit-3-ord": 7,
|
"credit-3-ord": 7,
|
||||||
"credit-3-summary": "withdrawal",
|
"credit-3-summary": "withdrawal",
|
||||||
@ -104,9 +109,33 @@ class RunTestCase(unittest.TestCase):
|
|||||||
"credit-6-account": "4611",
|
"credit-6-account": "4611",
|
||||||
"notes": "wonderful"})
|
"notes": "wonderful"})
|
||||||
self.assertEqual(response.status_code, 302)
|
self.assertEqual(response.status_code, 302)
|
||||||
|
self.assertNotEqual(response.headers["Location"], income_add_uri)
|
||||||
|
|
||||||
response = self.client.post(
|
response = self.client.post(
|
||||||
"/accounting/transactions/transfer/create?r=/ok",
|
transfer_add_uri,
|
||||||
|
{"date": today,
|
||||||
|
"debit-2-ord": 6,
|
||||||
|
"debit-2-summary": "lunch",
|
||||||
|
"debit-2-amount": 80,
|
||||||
|
"debit-2-account": "6272",
|
||||||
|
"debit-8-ord": 4,
|
||||||
|
"debit-8-summary": "movies",
|
||||||
|
"debit-8-amount": 320,
|
||||||
|
"debit-8-account": "6273",
|
||||||
|
"credit-3-ord": 7,
|
||||||
|
"credit-3-summary": "withdrawal",
|
||||||
|
"credit-3-amount": 100,
|
||||||
|
"credit-3-account": "1113",
|
||||||
|
"credit-6-ord": 3,
|
||||||
|
"credit-6-summary": "",
|
||||||
|
"credit-6-amount": 320,
|
||||||
|
"credit-6-account": "1111",
|
||||||
|
"notes": "nothing"})
|
||||||
|
self.assertEqual(response.status_code, 302)
|
||||||
|
self.assertEqual(response.headers["Location"], transfer_add_uri)
|
||||||
|
|
||||||
|
response = self.client.post(
|
||||||
|
transfer_add_uri,
|
||||||
{"date": today,
|
{"date": today,
|
||||||
"debit-2-ord": 6,
|
"debit-2-ord": 6,
|
||||||
"debit-2-summary": "lunch",
|
"debit-2-summary": "lunch",
|
||||||
@ -126,3 +155,4 @@ class RunTestCase(unittest.TestCase):
|
|||||||
"credit-6-account": "1111",
|
"credit-6-account": "1111",
|
||||||
"notes": "nothing"})
|
"notes": "nothing"})
|
||||||
self.assertEqual(response.status_code, 302)
|
self.assertEqual(response.status_code, 302)
|
||||||
|
self.assertNotEqual(response.headers["Location"], transfer_add_uri)
|
||||||
|
@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/3.2/ref/settings/
|
|||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from secrets import token_urlsafe
|
||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
@ -20,7 +21,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
|||||||
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
|
||||||
|
|
||||||
# SECURITY WARNING: keep the secret key used in production secret!
|
# SECURITY WARNING: keep the secret key used in production secret!
|
||||||
SECRET_KEY = 'django-insecure-vc+(5e-2xn%bc29&k#ah_vf17-)usz4af4y)njbp_k09)uev$$'
|
SECRET_KEY = token_urlsafe(48)
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
@ -111,8 +112,6 @@ TIME_ZONE = 'UTC'
|
|||||||
|
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
|
|
||||||
USE_L10N = True
|
|
||||||
|
|
||||||
USE_TZ = True
|
USE_TZ = True
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user