Hi there.
I have 2 declarative_base classes: Person and Inquiry. I have created
a relationship in Inquiry with a backref to Person.
When observing the an Inquiry object the person variable correctly
points to Person, however when observing Person objects I always get
an empty list in inquiries
I'm on MySQL and trying to create a type that stores enums as
VARCHAR(255). However, the following code still issues an ENUM() DDL.
What am I doing wrong here?
class StringEnum(types.TypeDecorator):
impl = types.Enum
def __init__(self, *args, **kwargs):
super(StringEnum,
TypeDecorator doesn't affect the decorated type via subclassing, it affects it
via the impl attribute, hence decorates. So you say self.impl =
Enum(...). You don't need to use TypeDecorator here if all you want to do
is create an Enum with default arguments, just subclass Enum directly.
On Aug 9, 2010, at 5:13 AM, zzer0 wrote:
Hi there.
I have 2 declarative_base classes: Person and Inquiry. I have created
a relationship in Inquiry with a backref to Person.
When observing the an Inquiry object the person variable correctly
points to Person, however when observing Person
It makes sense to subclass the type directly if I'm not messing with
result or bind values. This works:
class StringEnum(types.Enum):
def __init__(self, *args, **kwargs):
super(StringEnum, self).__init__(*args, native_enum=False,
**kwargs)
self.length = 255
I'm still curious
Hi
I thank you very much for your help. I managed to figure out that my
Inquiries table had no associated types in the actual sqlite database,
so after I changed the person_id field to Numeric, all was well and
done without changes to the code. Perhaps just to be aware of.
As for the Adjacency
Hi
I thank you very much for your help. I managed to figure out that my
Inquiries table had no associated types in the actual sqlite database,
so after I changed the person_id field to Numeric, all was well and
done without changes to the code. Perhaps just to be aware of.
As for the Adjacency
On Aug 9, 2010, at 10:32 AM, Nikolaj wrote:
It makes sense to subclass the type directly if I'm not messing with
result or bind values. This works:
class StringEnum(types.Enum):
def __init__(self, *args, **kwargs):
super(StringEnum, self).__init__(*args, native_enum=False,
On Aug 9, 3:38 pm, Michael Bayer mike...@zzzcomputing.com wrote:
its pulling off the types.Enum callable from self.__class__ (which actually
seems unnecessary here, self.impl should be fine), then calling that with the
given arguments. So it should be setting up the native_enum=False part
I have an association object pattern between Person and Item through
PersonItem. Item is subclassed using single-table inheritance into
FooItem and BarItem, with a column named 'foo' on FooItem (although
it's obviously on the same shared table as BarItem).
I'd like to query PersonItem and
On Aug 9, 2010, at 10:56 AM, Nikolaj wrote:
I have an association object pattern between Person and Item through
PersonItem. Item is subclassed using single-table inheritance into
FooItem and BarItem, with a column named 'foo' on FooItem (although
it's obviously on the same shared table as
There's a broken link on
http://www.sqlalchemy.org/docs/reference/dialects/sqlite.htm
to the old pysqlite project:
quoteFull documentation on pysqlite is available at:
http://www.initd.org/pub/software/pysqlite/doc/usage-guide.html/quote.
Can we get this update to link to:
On Aug 9, 2010, at 1:00 PM, BartonC wrote:
There's a broken link on
http://www.sqlalchemy.org/docs/reference/dialects/sqlite.htm
to the old pysqlite project:
quoteFull documentation on pysqlite is available at:
http://www.initd.org/pub/software/pysqlite/doc/usage-guide.html/quote.
Can we
Greetings, I have an object model which I'm persisting with
SQLAlchemy (0.6.3). I have a need for one of the objects in the model
to always merge itself into the session when a new instance is added.
For example, given
sub = Subscription(email=EmailAddress(value='f...@bar.com))
which will
On Aug 9, 2010, at 5:12 PM, flzz wrote:
Greetings, I have an object model which I'm persisting with
SQLAlchemy (0.6.3). I have a need for one of the objects in the model
to always merge itself into the session when a new instance is added.
For example, given
sub =
Hello,
I have these classes:
class Channel(rdb.Model):
rdb.metadata(metadata)
rdb.tablename(channels)
id = Column(id, Integer, primary_key=True)
title = Column(title, String(100))
items = relationship(MediaItem, secondary=channel_items,
On Aug 9, 2010, at 6:26 PM, Alvaro Reinoso wrote:
Hello,
I have these classes:
class Channel(rdb.Model):
rdb.metadata(metadata)
rdb.tablename(channels)
id = Column(id, Integer, primary_key=True)
title = Column(title, String(100))
items =
I tried setting isolation_level to SERIALIZABLE in my create_engine
options, while using psycopg2.
However, an strace clearly shows that it is using READ COMMITTED.
Is setting the isolation_level not supported with psycopg2?
--
See, when the GOVERNMENT spends money, it creates jobs; whereas
On Aug 10, 2010, at 12:03 AM, Jon Nelson wrote:
I tried setting isolation_level to SERIALIZABLE in my create_engine
options, while using psycopg2.
However, an strace clearly shows that it is using READ COMMITTED.
Is setting the isolation_level not supported with psycopg2?
Here's a test:
On Mon, Aug 9, 2010 at 11:27 PM, Michael Bayer mike...@zzzcomputing.com wrote:
On Aug 10, 2010, at 12:03 AM, Jon Nelson wrote:
I tried setting isolation_level to SERIALIZABLE in my create_engine
options, while using psycopg2.
However, an strace clearly shows that it is using READ COMMITTED.
20 matches
Mail list logo