MambuPy.rest.mambusaving

Mambu Savings objects.

MambuSaving holds a savings account.

MambuSavings holds a list of savings accounts.

Uses mambugeturl.getsavings as default urlfunc.

Classes

MambuSaving([urlfunc, entid])

A Savings account from Mambu.

MambuSavings([urlfunc, entid, itemclass])

A list of savings accounts from Mambu.

class MambuPy.rest.mambusaving.MambuSaving(urlfunc=<function getsavingssurl>, entid='', *args, **kwargs)[source]

Bases: MambuStruct

A Savings account from Mambu.

With the default urlfunc, entid argument must be the ID of the saving account you wish to retrieve.

__init__(urlfunc=<function getsavingssurl>, entid='', *args, **kwargs)[source]

Tasks done here:

Just initializes the MambuStruct.

__module__ = 'MambuPy.rest.mambusaving'
preprocess()[source]

Preprocessing.

Each active custom field is given a ‘name’ key that holds the field name, and for each keyed name, the value of the custom field is assigned.

setUser(*args, **kwargs)[source]

Adds the user for this savings account to a ‘user’ field.

User is a MambuUser object.

Returns the number of requests done to Mambu.

class MambuPy.rest.mambusaving.MambuSavings(urlfunc=<function getsavingssurl>, entid='', itemclass=<class 'MambuPy.rest.mambusaving.MambuSaving'>, *args, **kwargs)[source]

Bases: MambuStruct

A list of savings accounts from Mambu.

With the default urlfunc, entid argument must be empty at instantiation time to retrieve all the savings accounts according to any other filter you send to the urlfunc.

__init__(urlfunc=<function getsavingssurl>, entid='', itemclass=<class 'MambuPy.rest.mambusaving.MambuSaving'>, *args, **kwargs)[source]

By default, entid argument is empty. That makes perfect sense: you want several groups, not just one.

__iter__()[source]
__module__ = 'MambuPy.rest.mambusaving'
convert_dict_to_attrs(*args, **kwargs)[source]

The trick for iterable Mambu Objects comes here:

You iterate over each element of the responded List from Mambu, and create a MambuSaving (or your own itemclass) object for each one, initializing them one at a time, and changing the attrs attribute (which just holds a list of plain dictionaries) with a MambuSaving (or your own itemclass) just created.

Todo

pass a valid (perhaps default) urlfunc, and its corresponding id to entid to each itemclass, telling MambuStruct not to connect() by default. It’s desirable to connect at any other further moment to refresh some element in the list.