def __getattr__(self, attrname):
<EOL>prop = self._modelclass._properties.get(attrname)<EOL>if prop is None or prop._code_name != attrname:<EOL><INDENT>for prop in self._modelclass._properties.values():<EOL><INDENT>if prop._code_name == attrname:<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>prop = None<EOL><DEDENT><DEDENT>if prop is None:<EOL><INDENT>raise AttributeError('<STR_LIT>' %<EOL>(self._modelclass.__name__, attrname))<EOL><DEDENT>prop_copy = copy.copy(prop)<EOL>prop_copy._name = self._name + '<STR_LIT:.>' + prop_copy._name<EOL>setattr(self, attrname, prop_copy)<EOL>return prop_copy<EOL>
Dynamically get a subproperty.