[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-24 Thread Sébastien LELONG
Having a sqlalchemy.__version__ and revision (or whatever named vars) is definitly usefull, even more when there are frequent project releases such as with SA. +1 for this feature... Maybe just add one simple .revision as of svn's $Revision$, that should be okay for flying on devel. But the

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-24 Thread svilen
Maybe just add one simple .revision as of svn's $Revision$, that should be okay for flying on devel. But the file where you put this $Revision$ property has to be changed on every commit so the property is updated, no ? If so, this would give wrong revision number... if u touch the file

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-23 Thread svilen
while on polymorphic-union mappers vs non-polymorphic.. i have 3 kinds of type-queries: query_ALL-instances, quiery_BASE-instances, quiery_SUB-instances. First gives me all instances of a class or subclasess thereof, and is matching the main polymorphic-union mapper. The 3rd is a .select(

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-23 Thread Michael Bayer
your best bet: import pkg_resources as p p.get_distribution('sqlalchemy').version '0.3.3dev-r2190' still researching ways to make that more integrated but setuptools doesnt give a whole lot of options it seems. --~--~-~--~~~---~--~~ You received this message

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-23 Thread svilen
your best bet: import pkg_resources as p p.get_distribution('sqlalchemy').version '0.3.3dev-r2190' hm, this pkg_resources is from easy_setup or what? i dont have it. still researching ways to make that more integrated but setuptools doesnt give a whole lot of options it seems. yeah, i

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-23 Thread Michael Bayer
limited to non_primary mapper ? creating relationships with non_primary mapper is a bad idea. the foreignkey error really means, cant find a foreignkey *that I recognize as part of the parent or child tables*. On Jan 23, 2007, at 12:43 PM, svilen wrote: while on polymorphic-union

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-23 Thread sdobrev
limited to non_primary mapper ? creating relationships with non_primary mapper is a bad idea. the foreignkey error really means, cant find a foreignkey *that I recognize as part of the parent or child tables*. hmmm. u mean, making the non-primary mapper equivalent (relation-wise) to the

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-23 Thread sdobrev
okay, let me release something too. http://linuxteam.sistechnology.com/o2rm/sawrap0124.tar.bz2 i'm still looking for a name... Basic idea of this SAwrapper is to be 3rd-level declarative translator (SA has 2, non-declarative: orm-sqlpy, sqlpy-sql-dialect) and hide the SA's specifics, i.e.

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-21 Thread Michael Bayer
the concretes fail because concrete is not a completed feature at the momentim not even looking at those yet. the session.clear() should be done in all cases, the tests are completely pointless without it since you are just re-displaying the relationships you already constructed. so i made

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-21 Thread sdobrev
the concretes fail because concrete is not a completed feature at the momentim not even looking at those yet. the session.clear() should be done in all cases, the tests are completely pointless without it since you are just re-displaying the relationships you already constructed. so i

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-21 Thread sdobrev
creating non-dynamic forms of the failing tests, like 2 or 3 of them (i.e. one or two concretes, one sisters=True test), will save me the trouble of going through this script and extracting them myself. here. The thing generates them now itself. $python sa_ref_A_B_A_all.py relink

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-21 Thread Michael Bayer
im playing with some code to do this automatically, but looking back at sa_ref_A_B_A_all.py, change your primaryjoins to: mapper_A/link1: primaryjoin= table_A.c.link1_id==(Alink=='A' and (poly and Ajoin or table_A) or table_B).c.id, mapper_B/link2: primaryjoin= table_B.c.link2_id==(Blink=='A'

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-20 Thread Michael Bayer
changeset 2221 addresses the pattern youre doing in test_case3. it required SA is more strict about matching foreignkey columns in a relatoinship into the primary join condition, luckily all the unit tests still pass. this is because youre doing self-referential relationships on

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-19 Thread svilen
if you read closely, you can see that the embedded query for selecting the employee is wrong; it has no FROM clause: SELECT Employee.id AS id, Employee.name AS name, Employee.atype AS atype, Employee.manager_id AS manager_id \nWHERE Employee.atype = ? SQLite is a little dumb in that it doesnt

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-19 Thread Michael Bayer
sum up for me what the current bugs youre observing are. the foreignkey parameter is definitely needed for some of your cases. it un-ambiguates which column in the join condition is remote, for a join where its otherwise not clear. On Jan 19, 2007, at 7:32 AM, svilen wrote: and that

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-18 Thread svilen
From that point, we have a category of issue that comes up all the time, where what you want to do is possible, but SA never expected exactly what youre doing and ... This hinted me about another view point of what this wrapper of mine is: a storage for all the knowledge about how to use SA

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-18 Thread Michael Bayer
in both test cases, the stack trace reveals that the error occurs during the lazy load operation of the child items: File test_case2b.py, line 57, in ? print a.manager ... File /Users/classic/dev/sqlalchemy/lib/sqlalchemy/orm/strategies.py, line 220, in lazyload the query being issued

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-18 Thread Michael Bayer
and that change is in rev 2214, your two test scripts run unmodified now. --~--~-~--~~~---~--~~ 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

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-17 Thread svil
mmmh. This is about underlying base-framework of a system, equivalent in complexity to ERP. So i have unknown hierarchy of classes - be them documents, entities, whatever u fancy. And they can point to each other in an unknown way. if u want some example: DocumentA1 has some data and

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-17 Thread Michael Bayer
svil wrote: P.S. u can remove the other repeating post from another account fo mine - seems GG has weird latenicies, hence i double posted... and first one appeared 10hrs later than second. its because google marked them all as spam. seeing as there were 5 duplicate messages, i let one

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-17 Thread Michael Bayer
svil wrote: So i have unknown hierarchy of classes - be them documents, entities, whatever u fancy. And they can point to each other in an unknown way. so, you are looking to create an application that generates python applications, basically. if you want to use SA for that, you have to

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-17 Thread svil
So i have unknown hierarchy of classes - be them documents, entities, whatever u fancy. And they can point to each other in an unknown way. so, you are looking to create an application that generates python applications, basically. hm, can be interpreted this way. just add 'and interpret

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-17 Thread Michael Bayer
svil wrote: is it errorneus to explicitly put the (correct) joins even if they could be figured out by SA? its not. but made your code that much harder to read (there was a lot more that made it even harder, thats just one cherry-picked example). Two examples are the StaticType declarative

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-17 Thread svil
is it errorneus to explicitly put the (correct) joins even if they could be figured out by SA? its not. but made your code that much harder to read well, this case does require them :-( which has a way to interpret python functions into Expr-trees, which then can be translated (read

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-17 Thread Michael Bayer
On Jan 17, 2007, at 5:09 PM, svil wrote: 110. can't make it less ;-) can? and it is about A=Employee and B=Manager, and all Employees having a manager. http://linuxteam.sistechnology.com/orm/sa_B_inh_A_A_ref_AB2.py OK. the first attachment called test_case1.py is how I'd like you to send

[sqlalchemy] Re: ORM ramblings 2 - and announcing some o2r wrapper

2007-01-16 Thread Michael Bayer
hi - there is far too much in that post to respond to, and i dont have the resources to crack open a huge new API with loads of tests and just run through them all (and i did do the cracking part...156 files for a test case posted to a mailing list is 155 files too many)...the various things