Exemple #1
0
class Empleado:
    def __init__(self):
        self.conn = Connection('Farmacia')

    def insert_empleado(self, data):
        collection = 'empleado'
        self.conn.insert(collection, data)

    def update_empleado(self, condition, change):
        collection = 'empleado'
        self.conn.update(collection, condition, change)

    def get_empleado_condition_selection(self, condition, selection):
        collection = 'empleado'
        return self.conn.get_all(collection, condition, selection)

    def get_empleado_condition(self, condition):
        collection = 'empleado'
        return self.conn.get_one(collection, condition)

    def delete_empleado(self, condition):
        collection = 'empleado'
        self.conn.delete(collection, condition)

    def get_all_validacion(self, condition={}):
        return self.conn.get_all_validacion('empleado', condition)
Exemple #2
0
class Producto:
    def __init__(self):
        self.conn = Connection('tienda')

    def insert_producto(self, data):
        collection = 'producto'
        self.conn.insert(collection, data)

    def update_producto(self, condition, change):
        collection = 'producto'
        self.conn.update(collection, condition, change)

    def get_productos(self, condition, selection):
        collection = 'producto'
        return self.conn.get_all(collection, condition, selection)

    def get_producto(self, condition):
        collection = 'producto'
        return self.conn.get_one(collection, condition)

    def delete_producto(self, condition):
        collection = 'producto'
        self.conn.delete(collection, condition)
Exemple #3
0
class Categoria:
    def __init__(self):
        self.conn = Connection('tienda')

    def insert_categorias(self, data):
        collection = 'categoria'
        self.conn.insert(collection, data)

    def update_categoria(self, condition, change):
        collection = 'categoria'
        self.conn.update(collection, condition, change)

    def get_categorias(self, condition, selection):
        collection = 'categoria'
        return self.conn.get_all(collection, condition, selection)

    def get_categoria(self, condition):
        collection = 'categoria'
        return self.conn.get_one(collection, condition)

    def delete_categoria(self, condition):
        collection = 'categoria'
        self.conn.delete(collection, condition)
Exemple #4
0
class Lector:
    def __init__(self):
        self.model = Connection('biblioteca')

    def get_all_Lector(self,condition={}, select={}):
        return self.model.get_all('Lector',condition,select)

    def insert_Lector(self, data):
        return self.model.insert('Lector',data)

    def update_Lector(self, condition, change):
        return self.model.update('Lector',condition, change)

    def delete_Lector(self, condition):
        return self.model.delete('Lector', condition)
        
    def get_all_validacion(self,condition={}):
        return self.model.get_all_validacion('Lector',condition)
Exemple #5
0
class carrito:
    def __init__(self):
        self.model = Connection('Farmacia')

    def get_all_carrito(self, condition={}, select={}):
        return self.model.get_all('carrito', condition, select)

    def get_one_carrito(self, condition, select):
        return self.model.get_one('carrito', condition, select)

    def insert_carrito(self, data):
        return self.model.insert('carrito', data)

    def update_carrito(self, condition, change):
        return self.model.update('carrito', condition, change)
#

    def delete_carrito(self, condition):
        return self.model.delete('carrito', condition)

    def delete_carrito_all(self, condition):
        return self.model.delete_many('carrito', condition)