mirror of
https://github.com/yweber/lodel2.git
synced 2025-11-21 13:19:16 +01:00
[#61] changed params in the dummy data source class
This commit is contained in:
parent
e064173359
commit
96fbc2f45e
1 changed files with 12 additions and 8 deletions
|
|
@ -15,23 +15,27 @@ class DummyDatasource(object):
|
|||
## @brief update an existing LeObject
|
||||
# @param lodel_id (int) : list of lodel_id
|
||||
# @param checked_data dict
|
||||
def update(self, lodel_id, checked_data):
|
||||
print ("DummyDatasource.update: ", lodel_id, checked_data)
|
||||
# @param filters
|
||||
# @param relational_filters
|
||||
def update(self, lodel_id, checked_data, filters, relational_filters):
|
||||
print ("DummyDatasource.update: ", lodel_id, checked_data, filters, relational_filters)
|
||||
return True
|
||||
|
||||
## @brief create a new LeObject
|
||||
# @param typename string
|
||||
# @param classname string
|
||||
# @param letype LeType
|
||||
# @param leclass LeClass
|
||||
# @param data dict: a dictionnary of field:value to save
|
||||
# @return lodel_id int: new lodel_id of the newly created LeObject
|
||||
def insert(self, typename, classname, **datas):
|
||||
print("DummyDatasource.insert: ", typename, classname, datas)
|
||||
def insert(self, letype, leclass, **datas):
|
||||
print("DummyDatasource.insert: ", letype, leclass, datas)
|
||||
return 42
|
||||
|
||||
## @brief delete an existing LeObject
|
||||
# @param lodel_id int | (int): lodel_id of the object(s) to delete
|
||||
# @param filters list : list of tuples formatted as (FIELD, OPERATOR, VALUE)
|
||||
# @param relational_filters list
|
||||
# @return okay bool: True on success, it will raise on failure
|
||||
def delete(self, lodel_id):
|
||||
def delete(self, lodel_id, filters, relational_filters):
|
||||
print("DummyDatasource.delete: ", lodel_id)
|
||||
return True
|
||||
|
||||
|
|
@ -40,7 +44,7 @@ class DummyDatasource(object):
|
|||
# @param emtype LeType : LeType instance
|
||||
# @param field_list list : list of fields to get from the datasource
|
||||
# @param filters list : list of tuples formatted as (FIELD, OPERATOR, VALUE)
|
||||
# @param relational_filters
|
||||
# @param relational_filters list
|
||||
# @return responses ({string:*}): a list of dict with field:value
|
||||
def get(self, emclass, emtype, field_list, filters, relational_filters):
|
||||
print("DummyDatasource.get: ", emclass, emtype, field_list, filters, relational_filters)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue