Added "typeclass" as a shortcut variable name of __getattribute__. This allows for obj.typeclass to always cleanly return typeclass regardless of if obj is already a typeclass or is a database object. I.e. the same functionality of using obj.dbobj to always get the database object.

This commit is contained in:
Griatch 2013-02-03 00:23:58 +01:00
parent 7ba0683d9d
commit c0d634fe8c

View file

@ -97,6 +97,8 @@ class TypeClass(object):
"""
if propname == 'dbobj':
return _GA(self, 'dbobj')
if propname == 'typeclass':
return self
if propname.startswith('__') and propname.endswith('__'):
# python specials are parsed as-is (otherwise things like
# isinstance() fail to identify the typeclass)