21 |
# |
# |
22 |
# $Id$ |
# $Id$ |
23 |
|
|
24 |
|
import types |
25 |
from Base import * |
from Base import * |
26 |
from Namespace import * |
from Namespace import * |
27 |
from Property import * |
from Property import * |
125 |
self.classes = classDict |
self.classes = classDict |
126 |
self.module = module |
self.module = module |
127 |
self.definition = classDict.definition |
self.definition = classDict.definition |
128 |
self.fullName = createName (module.gnue_name, object.gnue_name) |
self.fullName = createName (module.gnue_name, self.gnue_name) |
129 |
self.table = self.fullName |
self.table = self.fullName |
130 |
|
|
131 |
self.properties = PropertyDict (classDict.session, classDict.modules, self) |
self.properties = PropertyDict (classDict.session, classDict.modules, self) |
135 |
# Attribute access is redirected into the gnue-namespace |
# Attribute access is redirected into the gnue-namespace |
136 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
137 |
def __getattr__ (self, attr): |
def __getattr__ (self, attr): |
138 |
return getattr (self._object, attr) |
value = getattr (self._object, attr) |
139 |
|
if isinstance (value, types.UnicodeType): |
140 |
|
return value.encode ('utf-8') |
141 |
|
else: |
142 |
|
return value |
143 |
|
|
144 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
145 |
# Return a property by name |
# Return a property by name |