accounting.currency package


accounting.currency.commands module

The console commands for the currency management.

accounting.currency.commands.init_currencies_command(username: str) None

Initializes the currencies.

accounting.currency.converters module

The path converters for the currency management.

class accounting.currency.converters.CurrencyConverter(map: Map, *args: t.Any, **kwargs: t.Any)

Bases: BaseConverter

The currency converter to convert the currency code and to the corresponding currency in the routes.

to_python(value: str) Currency

Converts a currency code to a currency.


value – The currency code.


The corresponding currency.

to_url(value: Currency) str

Converts a currency to its code.


value – The currency.


The code.

accounting.currency.forms module

The forms for the currency management.

class accounting.currency.forms.CodeUnique

Bases: object

The validator to check if the code is unique.

class accounting.currency.forms.CurrencyForm(*args, **kwargs)

Bases: FlaskForm

The form to create or edit a currency.

CODE_BLOCKLIST: list[str] = ['create', 'store', 'exists-code']

The reserved codes that are not available.

code = <UnboundField(StringField, (), {'filters': [<function strip_text>], 'validators': [<wtforms.validators.DataRequired object>, <wtforms.validators.Regexp object>, <wtforms.validators.NoneOf object>, <accounting.currency.forms.CodeUnique object>]})>

The code. It may not conflict with another currency.

name = <UnboundField(StringField, (), {'filters': [<function strip_text>], 'validators': [<wtforms.validators.DataRequired object>]})>

The name.

obj_code: str | None

The current code of the currency, or None when adding a new currency.

populate_obj(obj: Currency) None

Populates the form data into a currency object.


obj – The currency object.



accounting.currency.queries module

The queries for the currency management.

accounting.currency.queries.get_currency_query() list[Currency]

Returns the base accounts, optionally filtered by the query.


The base accounts.

accounting.currency.views module

The views for the currency management.

accounting.currency.views.api_bp: Blueprint = <Blueprint 'currency-api'>

The view blueprint for the currency management API.

accounting.currency.views.bp: Blueprint = <Blueprint 'currency'>

The view blueprint for the currency management.

Module contents

The currency management.

accounting.currency.init_app(app: Flask, bp: Blueprint) None

Initialize the application.

  • app – The Flask application.

  • bp – The blueprint of the accounting application.