Browse Source

Enhancement of LeObject get_from_uid method

Return an instance and not a list of len 1 anymore
Yann Weber 8 years ago
parent
commit
8a1aef8d68
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      lodel/leapi/leobject.py

+ 2
- 1
lodel/leapi/leobject.py View File

@@ -144,6 +144,7 @@ class LeObject(object):
144 144
     ##@brief Return the datahandler asssociated with a LeObject field
145 145
     # @param fieldname str : The fieldname
146 146
     # @return A data handler instance
147
+    #@todo update class of exception raised
147 148
     @classmethod
148 149
     def data_handler(cls, fieldname):
149 150
         if not fieldname in cls._fields:
@@ -623,7 +624,7 @@ construction and consitency when datas are not complete\n")
623 624
         if len(res) > 1:
624 625
             raise LodelFatalError("Get from uid returned more than one \
625 626
 object ! For class %s with uid value = %s" % (cls, uid))
626
-        return res
627
+        return res[0]
627 628
 
628 629
         
629 630
         

Loading…
Cancel
Save