Removed Deprecated "Fast Assignment" attribute operators.
This commit is contained in:
parent
58c010ef46
commit
0ac2a58428
1 changed files with 3 additions and 15 deletions
|
|
@ -113,12 +113,8 @@ class TypeClass(object):
|
||||||
try:
|
try:
|
||||||
return _GA(dbobj, propname)
|
return _GA(dbobj, propname)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
try:
|
string = "Object: '%s' not found on %s(#%s), nor on its typeclass %s."
|
||||||
#XXX deprecated
|
raise AttributeError(string % (propname, dbobj, _GA(dbobj, "dbid"), _GA(dbobj, "typeclass_path")))
|
||||||
return _GA(dbobj,"get_attribute_raise")(propname)
|
|
||||||
except AttributeError:
|
|
||||||
string = "Object: '%s' not found on %s(#%s), nor on its typeclass %s."
|
|
||||||
raise AttributeError(string % (propname, dbobj, _GA(dbobj, "dbid"), _GA(dbobj, "typeclass_path")))
|
|
||||||
|
|
||||||
def __setattr__(self, propname, value):
|
def __setattr__(self, propname, value):
|
||||||
"""
|
"""
|
||||||
|
|
@ -139,16 +135,8 @@ class TypeClass(object):
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
dbobj = None
|
dbobj = None
|
||||||
log_trace("This is probably due to an unsafe reload.")
|
log_trace("This is probably due to an unsafe reload.")
|
||||||
|
|
||||||
if dbobj:
|
if dbobj:
|
||||||
try:
|
_SA(dbobj, propname, value)
|
||||||
# only set value on propname if propname already exists
|
|
||||||
# on dbobj. __getattribute__ will raise attribute error otherwise.
|
|
||||||
_GA(dbobj, propname)
|
|
||||||
_SA(dbobj, propname, value)
|
|
||||||
except AttributeError:
|
|
||||||
#XXX deprecated
|
|
||||||
dbobj.set_attribute(propname, value)
|
|
||||||
else:
|
else:
|
||||||
_SA(self, propname, value)
|
_SA(self, propname, value)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue