I just got beta1 and I run into a problem with the following:

    sa.Column(u'consumedvalue', sa.Numeric(precision=18, length=2, 
asdecimal=True), sa.PassiveDefault("")),

consumedvalue is a readonly column (i.e. computed by Firebird SQL) and I 
am getting the following exception when I try to debug (in Boa), the 
same happens if I change the above to use ....server_default="".

Do I need to change something else in the model.  For each of these type 
of columns I also have the following:

class Consumption(object):
    def consumedvalue(self):
        return self._consumedvalue
    consumedvalue = property(consumedvalue)

Werner



Traceback (most recent call last):
  File "C:\Python25\Lib\site-packages\boa\Debugger\IsolatedDebugger.py", 
line 823, in run
    Bdb.run(self, cmd, globals, locals)
  File "C:\Python25\lib\bdb.py", line 366, in run
    exec cmd in globals, locals
  File "<string>", line 1, in <module>
  File "C:\Dev\twcb\Program\twcb.py", line 1108, in <module>
    main()
  File "C:\Dev\twcb\Program\twcb.py", line 1104, in main
    appl = BoaApp()
  File "C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", 
line 7912, in __init__
    self._BootstrapApp()
  File "C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", 
line 7487, in _BootstrapApp
    return _core_.PyApp__BootstrapApp(*args, **kwargs)
  File "C:\Dev\twcb\Program\twcb.py", line 266, in OnInit
    self.prefs = self.ds.query(db.prefminimal).get(1)
  File 
"c:\python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg\sqlalchemy\orm\session.py",
 
line 894, in query
    return self._query_cls(entities, self, **kwargs)
  File 
"c:\python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg\sqlalchemy\orm\query.py",
 
line 97, in __init__
    self.__setup_aliasizers(self._entities)
  File 
"c:\python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg\sqlalchemy\orm\query.py",
 
line 111, in __setup_aliasizers
    mapper, selectable, is_aliased_class = _entity_info(entity, 
ent.entity_name)
  File 
"c:\python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg\sqlalchemy\orm\util.py",
 
line 401, in _entity_info
    mapper = entity.compile()
  File 
"c:\python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg\sqlalchemy\orm\mapper.py",
 
line 370, in compile
    mapper.__initialize_properties()
  File 
"c:\python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg\sqlalchemy\orm\mapper.py",
 
line 391, in __initialize_properties
    prop.init(key, self)
  File 
"c:\python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg\sqlalchemy\orm\interfaces.py",
 
line 378, in init
    self.do_init()
  File 
"c:\python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg\sqlalchemy\orm\properties.py",
 
line 193, in do_init
    strategies.DefaultColumnLoader(self)._register_attribute(None, None, 
False, comparator_callable, proxy_property=self.descriptor)
  File 
"c:\python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg\sqlalchemy\orm\strategies.py",
 
line 37, in _register_attribute
    proxy_property=proxy_property
  File 
"c:\python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg\sqlalchemy\orm\unitofwork.py",
 
line 88, in register_attribute
    return attributes.register_attribute(class_, key, *args, **kwargs)
  File 
"c:\python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg\sqlalchemy\orm\attributes.py",
 
line 1407, in register_attribute
    descriptor = proxy_type(key, proxy_property, comparator, parententity)
  File 
"c:\python25\lib\site-packages\sqlalchemy-0.5.0beta1-py2.5.egg\sqlalchemy\orm\attributes.py",
 
line 144, in __init__
    self.descriptor = self.user_prop = descriptor
AttributeError: can't set attribute


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to