41 lines
857 B
Python
41 lines
857 B
Python
#!/usr/bin/env python
|
|
|
|
from . import main
|
|
|
|
|
|
class StorageEngine(object):
|
|
|
|
def __init__(self):
|
|
pass
|
|
|
|
def authenticate(self, args):
|
|
return main.authenticate(args)
|
|
|
|
def get_values(self, table, values=None):
|
|
return getattr(self, '_get_{}'.format(table))(values)
|
|
|
|
def _get_cp(self, values):
|
|
return main.get_cp(values['cp'])
|
|
|
|
def _get_formapago(self, values):
|
|
return main.SATFormaPago.get_activos()
|
|
|
|
def delete(self, table, id):
|
|
if table == 'partner':
|
|
return main.Socios.remove(id)
|
|
return False
|
|
|
|
def get_partners(self, values):
|
|
return main.Socios.get(values)
|
|
|
|
def partner(self, values):
|
|
id = int(values['id'])
|
|
del values['id']
|
|
if id:
|
|
return main.Socios.actualizar(values, id)
|
|
return main.Socios.add(values)
|
|
|
|
|
|
|
|
|