Nenhuma descrição
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

ledatasource.py 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #-*- coding: utf-8 -*-
  2. ## Generic DataSource for LeObject
  3. class LeDataSource(object):
  4. def __init__(self, module=None, *conn_args, **conn_kargs):
  5. self.module = module
  6. self.conn_args = conn_args
  7. self.conn_kargs = conn_kargs
  8. ## @brief update an existing LeObject
  9. # @param lodel_id (int) : list of lodel_id
  10. # @param checked_data dict
  11. # @param datasource_filters (string)
  12. def update(self, lodel_id, checked_data, datasource_filters):
  13. return True
  14. ## @brief insert
  15. # @param typename string
  16. # @param classname string
  17. # @param **datas dict
  18. def insert(self, typename, classname, **datas):
  19. return True
  20. ## @brief delete
  21. # @param lodel_id (int) : list of lode_id(s) to delete
  22. def delete(self, lodel_id):
  23. return True
  24. ## @brief search for a collection of objects
  25. # @param emclass LeClass : LeClass instance
  26. # @param emtype LeType : LeType instance
  27. # @param field_list list : list of fields to get from the datasource
  28. # @param filters list : list of tuples formatted as (FIELD, OPERATOR, VALUE)
  29. # @param relational_filters
  30. def get(self, emclass, emtype, field_list, filters, relational_filters):
  31. return {}