|
@@ -13,6 +13,17 @@ LodelContext.expose_modules(globals(), {
|
13
|
13
|
'lodel.plugin.hooks': ['LodelHook'],
|
14
|
14
|
'lodel.logger': ['logger']})
|
15
|
15
|
|
|
16
|
+##@brief Tool to check if a target_class's object exists and is stored
|
|
17
|
+#@param target_class : class where the object is supposed to be
|
|
18
|
+#@param uid : a unique id in target_class
|
|
19
|
+#@returns true if an object with unique id uid exists in target_class, false if not
|
|
20
|
+def is_exist(target_class, uid):
|
|
21
|
+ from .leobject import LeObject
|
|
22
|
+ if not inspect.isclass(target_class) or not issubclass(target_class, LeObject):
|
|
23
|
+ raise TypeError("target class has to be a child class of LeObject but %s was given"% target_class)
|
|
24
|
+ datasource = target_class._ro_datasource
|
|
25
|
+ return datasource.is_exist(target_class,uid)
|
|
26
|
+
|
16
|
27
|
|
17
|
28
|
##@todo check datas when running query
|
18
|
29
|
class LeQuery(object):
|