piecash._common module

piecash._common.hybrid_property_gncnumeric(num_col, denom_col)[source]

Return an hybrid_property handling a Decimal represented by a numerator and a denominator column. It assumes the python field related to the sqlcolumn is named as _sqlcolumn.

Returns:sqlalchemy.ext.hybrid.hybrid_property
class piecash._common.CallableList(*args)[source]

Bases: list

A simple class (inherited from list) allowing to retrieve a given list element with a filter on an attribute.

It can be used as the collection_class of a sqlalchemy relationship or to wrap any list (see examples in piecash.core.session.GncSession)

get(**kwargs)

Return the first element of the list that has attributes matching the kwargs dict. The get method is an alias for this method.

To be used as:

l(mnemonic="EUR", namespace="CURRENCY")