Hi All,
In 0.6_beta2, the following code is not properly adding a primary key Column
via DeclarativeMeta which calls my PrimaryKey() function:
def PrimaryKey(seqprefix):
return Column(Integer, Sequence(seqprefix, optional=True),
primary_key=True)
class ClassDefaults(DeclarativeMeta):
On Mar 23, 2010, at 9:29 AM, King Simon-NFHD78 wrote:
object_session does indeed return the session that the instance is
already bound to (so you shouldn't close it). I didn't know what
object_session would return if the original session had been closed, so
I tried it:
Thanks for looking into
In a metaclass's __init__, the attributes have already been placed on
the class, so mutating the attributes dict has no effect.
Try setting the id attribute directly:
self.id = PrimaryKey(...)
On Mar 27, 6:04 pm, Daniel Robbins drobb...@funtoo.org wrote:
Hi All,
In 0.6_beta2, the following
avdd wrote:
In a metaclass's __init__, the attributes have already been placed on
the class, so mutating the attributes dict has no effect.
Spot on. SA fudged this prior to 0.6beta so you could get away with
shoving stuff in dict_, you now can't...
def PrimaryKey(seqprefix):
return
Hi Michael,
I read http://www.sqlalchemy.org/trac/ticket/1751 with some curiousity.
My take on declarative mixins was that _as_declarative should basically
accumulate everything from the bases as if it were in the class itself
and then let _as_declarative behave exactly as it usually did on
Hi Again,
I'm also curious about use of dict_ versus getting from cls in
_as_declarative. IIRC, at pycon, you changed it so that DeclarativeMeta
passes the class's __dict__ as dict_ and then made it so that only dict_
is consulted for attributes.
However, _as_declarative intrinsically needs
Hi all!
I'm running SQLAlchemy 0.6b2 for a while and i've seem some strange
exception (AttributeError: 'NoneType' object has no attribute
'_sa_iterator') happening one in a while.
This is my stacktrace:
Traceback (most recent call last):
File /usr/lib/python2.5/threading.py, line 486, in
Well seems like the project you want to access is just None. SA can't do
anything with it. I had a similar problem recently, it was bacause the
objects got garbage collected before being accessed. A testcase would be
really helpful.
On Sat, 27 Mar 2010 17:42:20 +0100, Fernando Takai
On Mar 27, 2010, at 12:31 PM, Chris Withers wrote:
Hi Michael,
I read http://www.sqlalchemy.org/trac/ticket/1751 with some curiousity.
My take on declarative mixins was that _as_declarative should basically
accumulate everything from the bases as if it were in the class itself and
On Mar 27, 2010, at 12:35 PM, Chris Withers wrote:
Hi Again,
I'm also curious about use of dict_ versus getting from cls in
_as_declarative. IIRC, at pycon, you changed it so that DeclarativeMeta
passes the class's __dict__ as dict_ and then made it so that only dict_ is
consulted for
Michael Bayer wrote:
I'm also curious about use of dict_ versus getting from cls in _as_declarative.
IIRC, at pycon, you changed it so that DeclarativeMeta passes the class's
__dict__ as dict_ and then made it so that only dict_ is consulted for
attributes.
I did that, I thought, because
Michael Bayer wrote:
We can fine tune the restriction to be more about specifically what was in that
ticket, i.e.
BaseClass(Base)
some column
Mixin
some column with foreign key to BaseClass.some column
ActualClass(BaseClass)
some column that overrides BaseClass.some column
On Mar 27, 2010, at 12:42 PM, Fernando Takai wrote:
Hi all!
I'm running SQLAlchemy 0.6b2 for a while and i've seem some strange
exception (AttributeError: 'NoneType' object has no attribute
'_sa_iterator') happening one in a while.
This is my stacktrace:
Traceback (most recent call
On Mar 27, 2010, at 5:58 AM, Chris Withers wrote:
avdd wrote:
In a metaclass's __init__, the attributes have already been placed on
the class, so mutating the attributes dict has no effect.
Spot on. SA fudged this prior to 0.6beta so you could get away with shoving
stuff in dict_, you now
is it possible your object is present in a session that is, in a different
thread, being expired as this operation runs ?
I don't know, but i can verify that.
If that is happening, what can i do to prevent?
Well seems like the project you want to access is just None. SA can't do
anything
I've just discovered that some tinyint (8-bit) fields have had their
values limited to 0 and 1 regardless of actual value supplied. Digging
through the documentation, I've learned that when MySQL tables are
reflected, tinyint(1) fields are processed as booleans.
I did not find emails from others
On Mar 27, 2010, at 3:28 PM, Fernando Takai wrote:
is it possible your object is present in a session that is, in a different
thread, being expired as this operation runs ?
I don't know, but i can verify that.
If that is happening, what can i do to prevent?
an object associated with a
On Mar 27, 2010, at 4:16 PM, Lloyd Kvam wrote:
I've just discovered that some tinyint (8-bit) fields have had their
values limited to 0 and 1 regardless of actual value supplied. Digging
through the documentation, I've learned that when MySQL tables are
reflected, tinyint(1) fields are
On Mar 27, 2010, at 5:17 PM, Michael Bayer wrote:
On Mar 27, 2010, at 4:16 PM, Lloyd Kvam wrote:
I've just discovered that some tinyint (8-bit) fields have had their
values limited to 0 and 1 regardless of actual value supplied. Digging
through the documentation, I've learned that when
19 matches
Mail list logo