85 |
|
|
86 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
87 |
# Populate the list with a single instance with given gnue_id, and return |
# Populate the list with a single instance with given gnue_id, and return |
88 |
# that instance |
# that instance, return an exception if not found |
89 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
90 |
|
|
91 |
def find (self, object_id): |
def find (self, object_id): |
92 |
self.populate ([['eq', ''], ['field', 'gnue_id'], ['const', object_id]]) |
self.populate ([['eq', ''], ['field', 'gnue_id'], ['const', object_id]]) |
93 |
return self.firstInstance () |
result = self.firstInstance () |
94 |
|
if result == None: |
95 |
|
raise Exception, "Can't find object ID '%s' in class '%s'" % \ |
96 |
|
(object_id, self._classdef.fullName) |
97 |
|
return result |
98 |
|
|
99 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
100 |
# Populate the list with a single empty instance, and return that instance |
# Populate the list with a single empty instance, and return that instance |