Re: [sqlalchemy] bug in sqllite dialect?

2010-03-05 Thread Chris Withers
Michael Bayer wrote: Has anyone (hi, list, talking to you too!) already done a custom type for this specific problem? people do custom types for all sorts of things. In the case of the Decimal here I'd likely subclass sqlalchemy.databases.sqlite.SLNumeric which should ensure that your own

Re: [sqlalchemy] case sensitive Unicode and String columns

2010-03-05 Thread Chris Withers
Michael Bayer wrote: How do I do this? I think all databases that SQLAlchemy supports (in fact, likely all databases in use today) support case-sensitive strings by default, so I don't know if this something you'll need to worry about in your code. Maybe I am misunderstanding what you are

Re: [sqlalchemy] Re: [PROPOSE] Integrate migration support in SQLAlchemy

2010-03-05 Thread Manlio Perillo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Lele Gaifax ha scritto: Manlio Perillo manlio.peri...@gmail.com writes: Michael Bayer ha scritto: Similarly, the concept of a version as an integer number is not really flexible enough - The idea was to keep it simple. IMHE, there's no such

[sqlalchemy] Re: Getting access to the object being updated inside a default callable?

2010-03-05 Thread Oliver Beattie
Sorry to bug… I imagine there is no way of doing this, but would be good to know for sure. If not, this would be really useful functionality. For instance, I might want to populate one column based on the contents of one of more other columns. On 12 Jan, 11:21, Oliver Beattie oli...@obeattie.com

[sqlalchemy] three primary keys on association object

2010-03-05 Thread Sebastian Elsner
Hello, I have an association object declaratively with three primary keys, but on insert, the first (id) is not autoincremented. Please see test the code below from sqlalchemy import create_engine, Column,Integer, String, ForeignKey from sqlalchemy.ext.declarative import

Re: [sqlalchemy] bug in sqllite dialect?

2010-03-05 Thread Michael Bayer
Chris Withers wrote: Michael Bayer wrote: Has anyone (hi, list, talking to you too!) already done a custom type for this specific problem? people do custom types for all sorts of things. In the case of the Decimal here I'd likely subclass sqlalchemy.databases.sqlite.SLNumeric which should

Re: [sqlalchemy] case sensitive Unicode and String columns

2010-03-05 Thread Michael Bayer
Chris Withers wrote: Michael Bayer wrote: How do I do this? I think all databases that SQLAlchemy supports (in fact, likely all databases in use today) support case-sensitive strings by default, so I don't know if this something you'll need to worry about in your code. Maybe I am

Re: [sqlalchemy] Re: Getting access to the object being updated inside a default callable?

2010-03-05 Thread Michael Bayer
Oliver Beattie wrote: Sorry to bug… I imagine there is no way of doing this, but would be good to know for sure. If not, this would be really useful functionality. For instance, I might want to populate one column based on the contents of one of more other columns. On 12 Jan, 11:21, Oliver

Re: [sqlalchemy] three primary keys on association object

2010-03-05 Thread Michael Bayer
Sebastian Elsner wrote: Hello, I have an association object declaratively with three primary keys, but on insert, the first (id) is not autoincremented. Please see test the code below known sqlite limitation, described at

Re: [sqlalchemy] three primary keys on association object

2010-03-05 Thread Michael Bayer
Michael Bayer wrote: Sebastian Elsner wrote: Hello, I have an association object declaratively with three primary keys, but on insert, the first (id) is not autoincremented. Please see test the code below known sqlite limitation, described at

Re: [sqlalchemy] three primary keys on association object

2010-03-05 Thread Sebastian Elsner
Oh, thanks for the pointer. There's so much to read and learn being new to SQLAlchemy... Sorry for bugging. On Fri, 05 Mar 2010 15:49:03 +0100, Michael Bayer mike...@zzzcomputing.com wrote: Sebastian Elsner wrote: Hello, I have an association object declaratively with three primary

[sqlalchemy] Re: Getting access to the object being updated inside a default callable?

2010-03-05 Thread Oliver Beattie
Thanks for clarifying that. The MapperExtension is what I've been using so far for this, just wondered if there was a way to do this with column-level defaults. Now that I think about it though, the current way probably does make more sense, since if the values are dependent on outside influences,

[sqlalchemy] graph data structure with many edge types

2010-03-05 Thread JanW
I am trying to model graph data structure where nodes can be connected by different types of edges. For example, we could have 2 nodes represnting persons: Alice and Bob and we could have 3 nodes representing projects: projectA, projectB, projectC. Alice is working on projectA and projectC. Bob is

Re: [sqlalchemy] graph data structure with many edge types

2010-03-05 Thread Michael Bayer
JanW wrote: I am trying to model graph data structure where nodes can be connected by different types of edges. I would like to encode all this in 2 database tables: Node table: Edge table: I think this must be doable using the association_proxy in some way (it's vaguely familiar to the

[sqlalchemy] Re: insert defaults

2010-03-05 Thread patrick
Well it's something between the two. The instance variable compressed will always be NULL when adding or updating an instance, but I want it to infer a value from another instance variable. When inserting... the value of 'compressed' in the sql statement needs to be the raw SQL string

Re: [sqlalchemy] Re: insert defaults

2010-03-05 Thread Michael Bayer
On Mar 5, 2010, at 6:44 PM, patrick wrote: Well it's something between the two. The instance variable compressed will always be NULL when adding or updating an instance, but I want it to infer a value from another instance variable. When inserting... the value of 'compressed' in the sql