aboutsummaryrefslogtreecommitdiff
path: root/talerbank/app/management/commands/dump_talerdb.py
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2019-03-11 13:19:59 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2019-03-11 13:19:59 +0100
commitd531d61698e1e6d3eaa73922518eec40e80e3000 (patch)
treed3d3d7e27ff44eb31d1c93b06b11f8b47806380d /talerbank/app/management/commands/dump_talerdb.py
parent575666c5487847c360ad2b1ec3e2b920222d7faf (diff)
downloadbank-d531d61698e1e6d3eaa73922518eec40e80e3000.tar.gz
bank-d531d61698e1e6d3eaa73922518eec40e80e3000.tar.bz2
bank-d531d61698e1e6d3eaa73922518eec40e80e3000.zip
Doxygen-commenting dump_talerdb.py.
Diffstat (limited to 'talerbank/app/management/commands/dump_talerdb.py')
-rw-r--r--talerbank/app/management/commands/dump_talerdb.py28
1 files changed, 23 insertions, 5 deletions
diff --git a/talerbank/app/management/commands/dump_talerdb.py b/talerbank/app/management/commands/dump_talerdb.py
index 956c07e..ca9526c 100644
--- a/talerbank/app/management/commands/dump_talerdb.py
+++ b/talerbank/app/management/commands/dump_talerdb.py
@@ -1,12 +1,13 @@
-# This file is part of TALER
-# (C) 2014, 2015, 2106 INRIA
+##
+# This file is part of TALER
+# (C) 2014, 2015, 2106 INRIA
#
-# TALER is free software; you can redistribute it and/or modify
+# TALER is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation; either version 3, or (at your
# option) any later version.
#
-# TALER is distributed in the hope that it will be useful, but
+# TALER is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
@@ -15,7 +16,8 @@
# License along with TALER; see the file COPYING. If not, see
# <http://www.gnu.org/licenses/>
#
-# @author Marcello Stanisci
+# @author Marcello Stanisci
+# @brief dump database content in a pretty format.
import sys
import logging
@@ -25,6 +27,9 @@ from ...models import BankAccount, BankTransaction
LOGGER = logging.getLogger(__name__)
+
+##
+# Dump bank accounts that exist in the database.
def dump_accounts():
try:
accounts = BankAccount.objects.all()
@@ -40,6 +45,8 @@ def dump_accounts():
sys.exit(1)
+##
+# Dump all the transactions that exist in the database.
def dump_history():
try:
history = BankTransaction.objects.all()
@@ -55,7 +62,18 @@ def dump_history():
sys.exit(1)
+##
+# Django-specific class that register this CLI utility.
class Command(BaseCommand):
+
+ ##
+ # Django-specific callable that gets invoked when the user
+ # calls the CLI utility: simply, it calls the two helper
+ # functions defined above.
+ #
+ # @param self this object itself.
+ # @param args argument list (as passed by Django)
+ # @param options CLI options (also as passed by Django)
def handle(self, *args, **options):
dump_accounts()
dump_history()