|
@@ -28,13 +28,32 @@ class LeType(object):
|
28
|
28
|
if name not in self._fields:
|
29
|
29
|
raise AttributeError("No such field '%s' for %s"%(name, self.__class__.__name__)
|
30
|
30
|
setattr(self, name, value)
|
31
|
|
-
|
|
31
|
+
|
|
32
|
+ ## @brief Delete the LeType from Db
|
|
33
|
+ # @note equivalent to LeType::delete(this.lodel_id)
|
32
|
34
|
@classinstancemethod
|
33
|
35
|
def delete(self):
|
34
|
36
|
pass
|
35
|
37
|
|
|
38
|
+ ## @brief Delete a LeType from the datasource
|
|
39
|
+ # @param lodel_id int : The lodel_id identifying the LeType
|
|
40
|
+ # @param return True if deleted False if not existing
|
|
41
|
+ # @throw InvalidArgumentError if invalid parameters
|
|
42
|
+ # @throw Leo exception if the lodel_id identify an object from another type
|
36
|
43
|
@delete.classmethod
|
37
|
|
- def delete(cls, uid):
|
|
44
|
+ def delete(cls, uid_l):
|
|
45
|
+ pass
|
|
46
|
+
|
|
47
|
+ @classinstancemethod
|
|
48
|
+ ## @brief Update a LeType in db
|
|
49
|
+ def update(self):
|
|
50
|
+ pass
|
|
51
|
+
|
|
52
|
+ @update.classmethod
|
|
53
|
+ ## @brief Update some LeType in db
|
|
54
|
+ # @param datas : keys are lodel_id and value are dict of fieldname => value
|
|
55
|
+ # @throw Some exception for some errors in datas
|
|
56
|
+ def update(cls, datas):
|
38
|
57
|
pass
|
39
|
58
|
|
40
|
59
|
## @brief Insert a new LeType in the datasource
|
|
@@ -43,29 +62,10 @@ class LeType(object):
|
43
|
62
|
# @thorw A leo exception if invalid stuff
|
44
|
63
|
# @throw InvalidArgumentError if invalid argument
|
45
|
64
|
@classmethod
|
46
|
|
- def insert(cls, **datas):
|
|
65
|
+ def insert(self, **datas):
|
47
|
66
|
super(LeType, self).insert(typename=self.__class__.__name__, classname=self._leclass.__name__, **datas)
|
48
|
67
|
pass
|
49
|
68
|
|
50
|
|
- ## @brief Delete a LeType from the datasource
|
51
|
|
- # @param lodel_id int : The lodel_id identifying the LeType
|
52
|
|
- # @param return True if deleted False if not existing
|
53
|
|
- # @throw InvalidArgumentError if invalid parameters
|
54
|
|
- # @throw Leo exception if the lodel_id identify an object from another type
|
55
|
|
- @classmethod
|
56
|
|
- def c_delete(cls, lodel_id):
|
57
|
|
- pass
|
58
|
|
-
|
59
|
|
- ## @brief Update some objects in db
|
60
|
|
- # @param lodel_id_l list : A list of lodel_id to update
|
61
|
|
- # @param data dict : Represent the datas to update
|
62
|
|
- # @return True if updated else False
|
63
|
|
- # @throw InvalidArgumentError if invalid parameters
|
64
|
|
- # @throw other Leo exceptions
|
65
|
|
- @classmethod
|
66
|
|
- def c_update(cls, lodel_id_l, datas):
|
67
|
|
- pass
|
68
|
|
-
|
69
|
69
|
## @brief Check that datas are valid for this type
|
70
|
70
|
# @param datas dict : key == field name value are field values
|
71
|
71
|
# @param complete bool : if True expect that datas provide values for all non internal fields
|
|
@@ -106,16 +106,6 @@ class LeType(object):
|
106
|
106
|
self._fields[name].check_or_raise(value)
|
107
|
107
|
return super(LeType, self).__setattr__(name, value)
|
108
|
108
|
|
109
|
|
- ## @brief Delete the LeType
|
110
|
|
- # @return True if deleted False if not
|
111
|
|
- def delete(self):
|
112
|
|
- return self.__class__.delete(self.lodel_id)
|
113
|
|
-
|
114
|
|
- ## @brief Update a LeType
|
115
|
|
- # @return True if ok else False
|
116
|
|
- def update(self):
|
117
|
|
- return self.__class__.update(self.lodel_id, self._datas)
|
118
|
|
-
|
119
|
109
|
## @brief Fetch superiors
|
120
|
110
|
# @param nature str : The relation nature
|
121
|
111
|
# @return if no nature given return a dict with nature as key and arrays of LeObject as value. Else return an array of LeObject
|
|
@@ -134,6 +124,6 @@ class LeType(object):
|
134
|
124
|
# @param return True if done False if already done
|
135
|
125
|
# @throw A Leo exception if trying to link with an invalid leo
|
136
|
126
|
# @throw InvalidArgumentError if invalid argument
|
137
|
|
- def add_superior(self, nature, leo):
|
|
127
|
+ def set_superior(self, nature, leo):
|
138
|
128
|
pass
|
139
|
129
|
|