[sqlalchemy] Re: SQLAlchemy 0.4 MERGED TO TRUNK

2007-07-27 Thread sdobrev
On Friday 27 July 2007 19:48:51 Jonathan Ellis wrote: I'd want to make sure this didn't hurt performance first. (Seems innocuous enough, but if it's in any sort of inner loop the extra hash lookup might be noticeable.) if lookup is made once in the start of function, should be okay. which

[sqlalchemy] Re: a renaming proposal

2007-07-27 Thread sdobrev
btw around probing dbcook on 0.4, i got some sort of statistical idea of what is used often, some in a frightening repeatable pattern: from sqlalchemy import * db = create_engine('url') meta = MetaData(db) and just then all else follows... in 90% of my files. i can make some

[sqlalchemy] Re: Single table inheritance and mapping against a selectable

2007-07-27 Thread sdobrev
yeah look, this is how it works. your table has x, y, and z. you set up a mapper. x, y and z all become ColumnPropertys on your mapper, without you doing anything, i.e. no properties dict. if you set up a properties dict, columns which you map explicitly will override the normal x,

[sqlalchemy] Re: autoload'ing metadata

2007-07-26 Thread sdobrev
noone wanting to try autoload'ing nor metadatadiff? i am surprised.. Christophe, u can at least try how much autoload.py works like your autocode2 - i got lost with 'schema' vs 'dbname' - and/or add mysql support (;-) http://dbcook.svn.sourceforge.net/viewvc/*checkout*/dbcook/trunk/autoload.py

[sqlalchemy] Re: Consistency with DB while modifying metadata

2007-07-25 Thread sdobrev
On Wednesday 25 July 2007 19:34:50 Marco Mariani wrote: Anton V. Belyaev ha scritto: again, im not opposed to this feature and ill patch in an adequate (and fully unit-tested) implementation. but have you actually ever *had* this problem? or is it just hypothetical ? For example, a

[sqlalchemy] Re: autoload'ing metadata

2007-07-25 Thread sdobrev
here some theory on comparing data trees, in order to produce the changeset edit scripts. http://www.pri.univie.ac.at/Publications/2005/Eder_DAWAK2005_A_Tree_Comparison_Approach_to_Detect.pdf of course full automation is not possible and not needed - but why not do maximum effect/help with

[sqlalchemy] Re: no RowProxy.__getslice__

2007-07-25 Thread sdobrev
The trouble is (and, sorry, this is getting beyond SQLAlchemy- specific), that leaves me without any good ideas for how to distinguish sequence types (lists, tuples, and user-defined objects resembling them) from mappings (dicts). i usualy differ between sequences/generators and dicts by if

[sqlalchemy] Re: MSSQL Time

2007-07-24 Thread sdobrev
On Tuesday 24 July 2007 23:29:52 Rick Morrison wrote: The list is useful only for a hacker on the MSSQL module, not for general users, but FWIW, I've added it to http://www.sqlalchemy.org/trac/wiki/DatabaseNotes thanks I generally try to respond directly to help encourage anyone willing to

[sqlalchemy] Re: Issue when loading module in scheduler utility

2007-07-21 Thread sdobrev
this is the relative vs absolute import conflict, see python 2.5 news and the PEP about it. i'm not sure if last py2.5 really does all that, it didnt work here. The code u have, imports the module via different paths - some relative, e.g. current dir, and other absolute - e.g. via pythonpath,

[sqlalchemy] Re: Issue when loading module in scheduler utility

2007-07-21 Thread sdobrev
In other words, should I first attempt to __import__('vor.'+modname) in runJob() ? see the python reference about how to use __import__ over hierarchical paths, or use this instead def import_fullname( name): m = __import__( name) subnames = name.split('.')[1:] for k in subnames:

[sqlalchemy] Re: Issue when loading module in scheduler utility

2007-07-20 Thread sdobrev
this ain't SA issue, but if u want a solution, u have to provide more data, and do some prints here-there. When a scheduled job is run, its specified module is loaded using __import__ . This works fine unless the loaded module has an 'import model' in it. If so, I get this: Traceback (most

[sqlalchemy] dbcook 0.1

2007-07-18 Thread sdobrev
g'day. This is dbcook, a framework to cook databases from recipes, written as python declarations. Eventually the result may be edible (;-) (previous pre-names: sawrap, o2rm... it's about 10 months old now) If u're interested, have a look, dbcook/usage/example1.py might be a start. The

[sqlalchemy] dbcook 0.1

2007-07-18 Thread sdobrev
g'day. This is dbcook, a framework to cook databases from recipes, written as python declarations. Eventually the result may be edible (;-) (previous pre-names: sawrap, o2rm... it's about 10 months old now) If u're interested, have a look, dbcook/usage/example1.py might be a start. The

[sqlalchemy] Re: lazy = None behavior help...

2007-07-17 Thread sdobrev
if u can make the a query( primary_mapper, select_table) somehow possible... i won't need separate NPs. Note this selecttable is not additional .select() off the query, it IS the starting query(), e.g. thepolymorphic union in a big case and base-class-only in a small case.

[sqlalchemy] Re: MapperExtension ... is there a do_after_everything_else() hook?

2007-07-15 Thread sdobrev
thought it might. In my little MCV world, it's part of M, not C or V and I wanted to keep it that way as much as possible. It still is, just not in SA. i have similar thing into the M/odel, but it is pre_save(), not after_load(). So it's easier, and done by the sa-managing wrapper. Though

[sqlalchemy] Re: Multi-table inheritance and conflicting id columns

2007-07-15 Thread sdobrev
not an option. Neither is renaming DB columns. i was talking of renaming the column-names of SA/app, not those in the db. see key arg of Column(): key Defaults to None: an optional *alias name* for this column. The column will then be identified everywhere in an

[sqlalchemy] Re: SQLAlchemy 0.3.9 Released

2007-07-15 Thread sdobrev
- Using polymorphic, joined-table inheritance ? Forget about polymorphic_union(), just join all the tables together using outerjoin(). In 0.4, even the select_table argument becomes optional. i am not sure if i got this right (a month already). A-B-C works, yes. But just explain to

[sqlalchemy] Re: SQLAlchemy 0.3.9 Released

2007-07-15 Thread sdobrev
- Using polymorphic, joined-table inheritance ? Forget about polymorphic_union(), just join all the tables together using outerjoin(). In 0.4, even the select_table argument becomes optional. i am not sure if i got this right (a month already). A-B-C works, yes. But just explain

[sqlalchemy] Re: Multi-table inheritance and conflicting id columns

2007-07-13 Thread sdobrev
i played a bit with your thing... how do u expect the id column to appear in the Employee actualy? do u expect to get the base person' one, or the child one? or both? looking from the child, yes, the child one will obscure the parent one, but from the parent.. u'll never get the child one. i

[sqlalchemy] Re: SAContext 0.3.0

2007-07-11 Thread sdobrev
On Wednesday 11 July 2007 21:49:48 Mike Orr wrote: On 7/11/07, Jose Galvez [EMAIL PROTECTED] wrote: Dear Mike, I've read the doc string in the new sacontext and was just wondering why for add_engine_from_config do you have to explicitly pass None for the default connection? it would make

[sqlalchemy] simple query and prop.get_join()

2007-07-11 Thread sdobrev
Lets say there are Employee, Engineer, Manager, etc whole tree, with Employee in the root; all levels do have instances and its polymorphical multitable inheritance. Let's the Employee has attribute age - number, and manager - pointing to some other Employee. how to get all Employees which

[sqlalchemy] Re: simple query and prop.get_join()

2007-07-11 Thread sdobrev
anyway, i copied prop.get_join and removed all polymorphic stuff + cache, and now such expressions work. Gaetan, u still interested in this db-cooker of mine? i think i have something to show... --~--~-~--~~~---~--~~ You received this message because you are

[sqlalchemy] Re: whats going to break in 0.4

2007-07-04 Thread sdobrev
the new interface is super clean, consistent and flexible. and with that, we are able to add more features onto it. a cluttered interface doesn't accept new functionalities as easily. There was one more difference betwen filter* and select* - first is just building a query, 2nd is building

[sqlalchemy] Re: SAContext and transactions?

2007-06-29 Thread sdobrev
SAContext is a little top-level organizer for engines, metadatas, and a session context. It was written for Pylons due to the confusion people were having setting up their models, but the SAContext class itself can be used in any SQLAlchemy application.

[sqlalchemy] Re: SAContext and transactions?

2007-06-29 Thread sdobrev
it's all okay. i just thought that if it is a Context, u should have some destructors - as u call many constructors. otherwise it is not reentrant - or at least repeatable. But if the idea is that this context will always be one-and-only, lives forever, and all db-stuff will happen within

[sqlalchemy] Re: column_prefix with synonym

2007-06-28 Thread sdobrev
On Thursday 28 June 2007 17:50:17 Michael Bayer wrote: On Jun 28, 2007, at 4:12 AM, svilen wrote: i have some opinion/wishes around this one too. i have a complete validating/verificating descriptors for all my attributes (plus no other attributes are allowed on my model-related classes

[sqlalchemy] Re: advanced mapping help

2007-06-23 Thread sdobrev
u may need an explicit intermediate association object, see the docs about many to many relations. Instead of directly getting the children, u'll get the associations via which u can get the children, or whatever attributes of the link. Then if u want a direct children-list, u can make some

[sqlalchemy] Re: session.clear() not clearing cascaded items?

2007-06-21 Thread sdobrev
thanks a lot, that cleared some mist. btw u can make a entry on the FAQ from this... e.g. lifetimes and usage patterns - or similar. The other rule inferred from above problem is b) objects lifetime should be shorter than mappers (ORM); else one needs to delete o._instance_key and

[sqlalchemy] Re: How to catch a changed event in ORM

2007-06-20 Thread sdobrev
sorry, http://linuxteam.sistechnology.com/o2rm/o2rm0224.tar.bz2 Thank you but when I try downloading http://www.sistechnology.com/o2rm/o2rm0224.tar.bz2, I get a 404 not found :-( --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[sqlalchemy] Re: How to catch a changed event in ORM

2007-06-20 Thread sdobrev
I'm working in a GUI project and use the SQLAlchemy for ORM. Can anyone tell me how to catch a attribute changed event in SQLAlchemy so that application can update the UI automaticly. depending on how/when exactly are u going to check for attr-change, u can look for 'dirtyness' of the

[sqlalchemy] Re: Trying to detect which class methods were added by the mapper.

2007-06-13 Thread sdobrev
are u using assign_mapper? use plain mappers to have minimal impact, u will still get plenty of new descriptors + __init__ replaced On Wednesday 13 June 2007 07:35:16 Ian Charnas wrote: Inspired by the SQLAlchemy docs, I'm writing a documentation generator in python using a combination of

[sqlalchemy] Re: Deleting single association in many-to-many relationship

2007-06-13 Thread sdobrev
what version u use? i tried your thing, that is $ python -i zz.py s = create_session() j = s.query(Job)[0] #get first del j.files[0] s.flush() and seems to work before: for a in s.query(Job): print a.name, a.files ... Job 1 [__main__.File object at 0xb78ec72c, __main__.File object at

[sqlalchemy] Re: Query.get with unordered multiple-column-primary-key

2007-06-13 Thread sdobrev
Some of my coworkers had the same needs of Gaetan... And while I understand your solution, I figure out if SA could have it natively (detecting the presence of a dictionary)... Somethink like: query.get(dict(columnB='foo', columnA='bar') Lazy programmers are the best ones... :) why

[sqlalchemy] Re: Query.get with unordered multiple-column-primary-key

2007-06-13 Thread sdobrev
well, if u dont want to write the same thing over and over, write one wrapping function, and publish it here. e.g. something like (pseudocode): def _get_pk_ordered( klas): table = orm.mapper.registry(klas).mapped_table #or select_table return whatever-list-of-columns def

[sqlalchemy] Re: Deleting single association in many-to-many relationship

2007-06-13 Thread sdobrev
On the second point, the complexity of the full cascade recursion with orphan detection makes sense. I suppose I'm interested in any input from anyone else as to how they are handling these sorts of operations in many-to-many cases with changing associations. As i need a history

[sqlalchemy] Re: dictionaries collection_class

2007-06-12 Thread sdobrev
the legal way is the association_proxy and family. here another shorter ... a hack: i did have similar need - obj.somerelation.append( left=.., right=..), so i did monkeypatch the InstrumentedList's append to use the item returned from collection's append - def append( self, *args,

[sqlalchemy] Re: remember that polymorphic_union function ?

2007-06-09 Thread sdobrev
I know ive put many folks through the wringer dealing with this function, in order to get their inherited mappers to load instances polymorphically. It seems like we probably dont need it for the most common case, which is that you are using only joined-table inheritance from a single

[sqlalchemy] Re: Generative style on SQL-API layer

2007-06-05 Thread sdobrev
hmm, actualy, in such select.append_whereclause().order_by().group_by().whatever1 ().whatever2()... What is the point of anything except the very first funccall to be generative? the direct results are thrown away, and the copies are used - whyfore? (i guess this applies to query() as

[sqlalchemy] Re: [PATCH] filter_by_via

2007-06-02 Thread sdobrev
what about adding a docopy=True (or dont_copy=False) to all methods that could be both copy_generative and modify-in-place? via some generic self=self.copy_if_required() func? Then one can choose at which point to split+copy let me summarize things that im thinking we do: - we want to go

[sqlalchemy] Re: [PATCH] filter_by_via

2007-06-02 Thread sdobrev
what about adding a docopy=True (or dont_copy=False) to all methods that could be both copy_generative and modify-in-place? via some generic self=self.copy_if_required() func? Then one can choose at which point to split+copy well if you have switches that are dynamically modifying the

[sqlalchemy] Re: [PATCH] filter_by_via

2007-06-01 Thread sdobrev
On Friday 01 June 2007 21:38:15 Michael Bayer wrote: On Jun 1, 2007, at 1:24 PM, Michael Bayer wrote: and we can even bring back a modified version auto-descend in that case: query(A).filter_by(C, lala=5) since above its not ambiguous. actually, scratch that. C can be related to

[sqlalchemy] Re: assign_mapper query methods

2007-05-31 Thread sdobrev
maybe keep only _one_ method which gives a fullblown Query() object, which then can be used as one wish? On Friday 01 June 2007 06:47:01 Michael Bayer wrote: heres the question. Query gets 10 new methods one day. do we then add 10 methods to assign_mapper() ? must the user class be a total

[sqlalchemy] Re: how to retrieve/update data from/on multiple databases

2007-05-30 Thread sdobrev
I'm not sure how querying should work, I guess doing a get by primary key should automatically use the correct database. What about other searches? Do these consult all the databases and merge the results? And what about joins? i would expect so. and a way to say .search(all) or search(

[sqlalchemy] Re: pattern about nested transactions?

2007-05-28 Thread sdobrev
add on top of this versioning/bitemporalism and things get tough... big words again...hold on...zero google hits for 'bitemporalism'...OK i guess that means two things happening at once I think he means the distinction between actual time and record time of temporal objects as

[sqlalchemy] Re: pattern about nested transactions?

2007-05-28 Thread sdobrev
On Monday 28 May 2007 23:43:37 Michael Bayer wrote: On May 28, 2007, at 3:33 AM, [EMAIL PROTECTED] wrote: To avoid trouble if erasing fails, i may also add some sort of state-flag is_temporary to all those records, so they can be visible within the transaction (flag is True), but not

[sqlalchemy] Re: Arguments for SA over django ORM

2007-04-26 Thread sdobrev
I've got a meeting coming up with a small team from a commercial DB vendor that's interested in extending their support into the Python community (yea!). Unfortunately, their analysis up until this point has left them with the impression that supporting the django ORM is the first priority,

[sqlalchemy] Re: Bug in select/offset limit

2007-04-20 Thread sdobrev
On Friday 20 April 2007 16:59:55 Michael Bayer wrote: On Apr 20, 2007, at 5:00 AM, Ram Yalamanchili wrote: I have this piece of code which I came across accidentally: page = 0 limit = '1' # note that one of the above values is a string, and the other a 0 data =

[sqlalchemy] Re: Mapping to table column data rather than an ORM object using relation()

2007-04-15 Thread sdobrev
u could workaround by adding another python property to Pet: class Pet: directspecies = property( lambda self: self.species.species, ...) svil On Sunday 15 April 2007 02:51:07 Brendan Arnold wrote: Hi there, Lets say I have a table with a foreign key that relates to another table with and

[sqlalchemy] Re: IN() bug bit hard

2007-04-13 Thread sdobrev
#476 - forget the visitor stuff; i use the simpler code that is in the text of 02/15/07 09:59:22 changed by svil comment, for some 2 months now, and all is ok. i've added the patch/code to that ticket as well as to #474/475. On Friday 13 April 2007 23:17:37 Ants Aasma wrote: On Apr 13, 10:16

[sqlalchemy] Re: association obj/proxy

2007-04-06 Thread sdobrev
seems this is the month of the many2many relations ;-) more on the theme: many2many i have a association of 3 tables, A,B,C. one of them (C) may not be present in all assoc_items. So that column has nullable=True. when you say, association of 3 tables, A,B, C, do you mean, there

[sqlalchemy] Re: deferred join against details table in polymorphic union for performance

2007-03-27 Thread sdobrev
On Tuesday 27 March 2007 17:18:04 Michael Bayer wrote: On Mar 27, 2007, at 3:53 AM, [EMAIL PROTECTED] wrote: Lets say u have 5 leaf types in 4-5 levels of the hierarchy tree, say that makes 10 tables total. say E object is a leaf and comes from A.join(B).join(C).join(E) - so E is split

[sqlalchemy] Re: How to deal with non-ASCII(such as Chinese)table name?

2007-03-27 Thread sdobrev
On Tuesday 27 March 2007 18:12:37 Chen Houwu wrote: from the docstring in class Column: def __init__() name The name of this column. This should be the identical name as it appears, or will appear, in the database. key Defaults to None: an optional alias name

[sqlalchemy] Re: How to deal with non-ASCII(such as Chinese)table name?

2007-03-24 Thread sdobrev
try Column()'s parameters quote=.. and key=.., doc/docstrings.html#docstrings_sqlalchemy.schema_Column and/or mapper's explicit column-naming: doc/adv_datamapping.html#advdatamapping_properties_colname On Sunday 25 March 2007 08:04:02 Chen Houwu wrote: from the sqlalchemy documentation, I

[sqlalchemy] Re: eagerload of inherited polymorphic class via relation

2007-03-24 Thread sdobrev
On Saturday 24 March 2007 21:35:19 Michael Bayer wrote: On Mar 24, 2007, at 4:38 PM, [EMAIL PROTECTED] wrote: i would also say its slightly better in the case of joined table inheritance to *not* query for the type column as well since it can add weight to the query. hmm, probably. how

[sqlalchemy] Re: polymorphic problem in 0.3.5

2007-03-21 Thread sdobrev
isn't polymorphic_union( { 'a': select..., 'b': select... }, 'kind' ) working in your case? On Wednesday 21 March 2007 21:37:47 Toshio Kuratomi wrote: Hi guys. I'm using sqlalchemy with TurboGears. The code for my project is GPL, so if you need access to more source just let me know: I

[sqlalchemy] Re: Replicating a transaction

2007-03-20 Thread sdobrev
On Tuesday 20 March 2007 07:47:53 Benno Rice wrote: Hi, I'm wondering if it would be possible to have a situation where transactions coming in from the ORM system could be sent to multiple database servers at once. If I were to look into adding this, where would be the best place to

[sqlalchemy] Re: Quoting column names on table create?

2007-03-14 Thread sdobrev
because a) SQL-standard says names are caseless - Fun anf fUn are same thing b) most SQLs allow mixed case but require it in quotes, and some are _very_ picky about it (postgres) c) readability - lowercase names differs well from uppercase reserved words On Thursday 15 March 2007 06:26:03

[sqlalchemy] Re: DynamicMetaData question

2007-03-13 Thread sdobrev
What do you think? Hey list, are you confused by the current system ? Please let me know. the only change I would favor here would be to merge connect into MetaData, BoundMetaData and DynamicMetaData stay around for backwards compat for probably forever, and perhaps we add another

[sqlalchemy] rev2362 fixes one thing and breaks another

2007-02-27 Thread sdobrev
hallo. AFAIsee rev 2362 fixes the lazy-load for polymorphic properties. but is seems to introduce another problem.. or maybe uncover it. table-inheritance, A-B-C-D, and A has reference to B. 2361: lazy-ref is loaded wrong ... File /home/az/src/hor-trunk/db/sawrap/tests/sa_gentestbase.py,

[sqlalchemy] Re: Error with Self Referential Tutorial

2007-02-22 Thread sdobrev
try putting primaryjoin=... inside the backref() I've been trying to recreate the self referential 'parent/child' mapper tutorial: http://www.sqlalchemy.org/docs/adv_datamapping.myt#advdatamapping_s elfreferential I keep getting the following error: Error determining primary and/or

[sqlalchemy] Re: query on table-inheritance, self-referencing mappers

2007-02-15 Thread sdobrev
final, ok for indirect recursion too . ## import sqlalchemy def join_via( keys, mapper): '''Query.join_via, input root mapper, return last mapper/table; alias and link properly recursive /self-referential joins ''' clause = None c = None self_table = None

[sqlalchemy] Re: arbitrary join/select from a given list

2007-02-05 Thread sdobrev
i'm not sure if i understand what u want, but u can do nested join( prev_join, table_next). Also see the full spec of select( columns_list, whereclause, from_obj_list, order_by, group_by, ) something like table_a.join(table_b).join(c).join(d).select([columns_here]) for the implicit

[sqlalchemy] Re: Inspect and __init__ of a mapped class

2007-02-05 Thread sdobrev
oh right, old_init(), sorry, didnt read the first post carefully. i almost think the answer here might be to not even create the modified __init__()/old_init() method in the general case...if youre calling session.save(someobject) its not really needed. but for now...maybe

[sqlalchemy] Re: Inspect and __init__ of a mapped class

2007-02-04 Thread sdobrev
I'm trying to create a mapped object where I don't know what the exact constructor arguments of the object might be. I was trying to use the inspect module to get the right arguments, but it looks like the mapper is redefining the original class __init__. Any thoughts as to how I might

[sqlalchemy] Re: Unit testing with SA?

2007-02-03 Thread sdobrev
There is more; to have really independent tests u have to destroy all SA caches and mappers etc. metadata.drop_all() clear_mappers() db.dispose() and always let ALL sessions etc fall out of scope. Make sure u do not store exception contexts, nor any persistent objects between the tests.

[sqlalchemy] Re: what is considered circular dep at session.flush() ?

2007-02-03 Thread sdobrev
yeah im no mathematician but i dont think you can use just part of a theory thats designed for flow diagrams with some totally different kind of diagram. well, relational algebra, or graph theory is just that, and can be used for wbatever one finds applicable. diff Application aspects may

[sqlalchemy] Re: what is considered circular dep at session.flush() ?

2007-02-03 Thread sdobrev
noting that, i have spent almost no time at all on supporting concrete patterns at this point (also, nobody has really complained). no worries, i've doing now a cut over proper graph, built in similar way as the one unitofwork's topology is using, scratch that, instead i propagated a

[sqlalchemy] Re: any particular reason for creating unused lists?

2007-02-03 Thread sdobrev
- using value.lower() == value instead of value.islower() ha x = 27 x.islower() False x.lower() == x True breaks a lot of tests too okay, forget that. Here an example OrderedSet over set; that seems to give a bigger speedup than anything else, and without touching anything.

[sqlalchemy] Re: any particular reason for creating unused lists?

2007-01-31 Thread sdobrev
another things i noted: - using value.lower() == value instead of value.islower() - ansisql.py: in _requires_quotes(): this bool(len([x for x in str(value) if x not in self._legal_characters()])) should be same as bool( s.translate( 256*' ',

[sqlalchemy] Re: polymorphic mapping with more than 2 level of inheritance

2007-01-30 Thread sdobrev
Here one more random pick, of same errors. There are only these 3 kinds of errors in the whole run, lazy+eager, about 9800 cases, and about 4700 errors (also attached): - some B being loaded as C /4500 - sqlError- no such column pu_B.linkB_id /224 - circularDep /42 The first one plays tricks,

[sqlalchemy] Re: polymorphic mapping with more than 2 level of inheritance

2007-01-29 Thread sdobrev
here next portion - 3 kinds, one case per kind. all tests pass with rev 2267 of that branch. try that rev specifically, since i want to take whats there and do another pass. im trying to get it so that the entire science of parent table, child table, polymorphic selectables, primary join -

[sqlalchemy] Re: polymorphic mapping with more than 2 level of inheritance

2007-01-29 Thread sdobrev
here next portion - 3 kinds, one case per kind. hm.hmmm. on sqlite they were 3 failing - now only 2; on postgres all 3 fail... The cirlcular dep one - is there because i cannot get where the circ-dep is. The post-updates are invented by the mincut algo, and i don't see why such configuration

[sqlalchemy] Re: polymorphic mapping with more than 2 level of inheritance

2007-01-28 Thread sdobrev
So, ive been working on this crapola pretty much all day... WAW! hey, don't overdose... (YOURE WELCOME) ... Hhmm. i don't believe in virtual beers, so maybe, treat you with this? http://www.giovannisample.com/media/mondo/Mondovision640.zip and the latest is in a branch

[sqlalchemy] Re: polymorphic mapping with more than 2 level of inheritance

2007-01-28 Thread sdobrev
all tests pass with rev 2267 of that branch. try that rev specifically, since i want to take whats there and do another pass. im trying to get it so that the entire science of parent table, child table, polymorphic selectables, primary join - polymorphic joins - determine direction/lazy

[sqlalchemy] Re: some failures on polymorphic-mapper with non-lazy relations

2007-01-26 Thread sdobrev
Employee points to Dept and Dept points to Director; Director inherits Employee. no other references. thats not the test case im talking about, you gave me just A and B with B point to A (which is A pointing to A). that right, i found another case giving the same error, and thought it

[sqlalchemy] Re: Persistence Layer best practices with SQLAlchemy

2007-01-26 Thread sdobrev
Mike, On a side note, do u have any ideas about supporting stored procedures in some way? Be it just knowing about them and maybe calling them, or on the other end, generating them? IMO they are _some_ way to hide some of those session.queries... Although i'm just extrapolating my own vision

[sqlalchemy] Re: some failures on polymorphic-mapper with non-lazy relations

2007-01-26 Thread sdobrev
Can we invent some practical rule about what cannot (or should not) be lazy? sorry, what cannot (or should not) be _eager_ a) self-reference and inheritance between pointing and pointed, in any direction b) anything else ?? --~--~-~--~~~---~--~~ You

[sqlalchemy] some failures on polymorphic-mapper with non-lazy relations

2007-01-25 Thread sdobrev
i have added a switch for lazy on/off to that 115-case full combination test for A-B inheritance and relations. For lazy=True all is ok. For lazy=False, i am setting lazy=False only for those relations which refer to klas not a subklas to the main one. The result is 8 cases fail, all of same

[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] how to make a query for multilevel reference?

2007-01-21 Thread sdobrev
hi. Lets have a Person having .address having .country having .name. How would give-me-persons-which-live-in France be expressed in SA (sorry for my SQL ignorance)? e.g. all-persons-for-which person.address.country.name == 'France' thanks svil

[sqlalchemy] Re: how to make a query for multilevel reference?

2007-01-21 Thread sdobrev
Lets have a Person having .address having .country having .name. How would give-me-persons-which-live-in France be expressed in SA (sorry for my SQL ignorance)? e.g. all-persons-for-which person.address.country.name == 'France'

[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

<    1   2