[sqlalchemy] Re: InstrumentedList in SA 0.4.3

2008-03-05 Thread svilen
see sqlalchemy.orm.collections.py. The collections are reworked in 0.4.x, so check if your usage is still valid or has to be changed too. On Wednesday 05 March 2008 18:06:23 Acm wrote: > With SA version 0.3.11 I used to import InstrumentedList as > follows: from sqlalchemy.orm.attributes import

[sqlalchemy] Re: Intersect of ORM queries

2008-03-05 Thread svilen
pardon my sql-ignorancy, but cant u express this in just one expression? it should be possible, it is a graph/set arithmetics after all... mmh, (could be very wrong!) something like - get all rows that has some b_id from the looked list - group(?) somehow by a_id, and then finger the a_id wh

[sqlalchemy] Re: AuditLog my first attempt

2008-03-04 Thread svilen
On Tuesday 04 March 2008 12:34:11 Marco De Felice wrote: > So after some coding and thanks to sdobrev previous reply I came up > with the following mapperextension that allows for a client side > update log to a different table (logtable name = table_prefix + > original table name) with a logopera

[sqlalchemy] Re: Has anyone implemented a "dict of lists" collection_class?

2008-02-18 Thread svilen
> Actually, I don't need or want the ability to append or remove > entire subsets. There will only be a single element appended or > removed at a time. It's just that when a Bar is added to one of > these "children" collections, I want it to be filed under a dict > slot whose key happens to be t

[sqlalchemy] Re: Joined Table Inheritance

2008-02-18 Thread svilen
AFAIK, the polymorphic_identity value there is used: a) for queries, to discriminate/switch between object-types b) for inserts, to put _that value when inserting that object-type. i.e. to me these values ought to be some consts, different for each subtype in the hierarchy. As of sharing that

[sqlalchemy] Re: building mappers for an existing database

2008-02-11 Thread svilen
On Monday 11 February 2008 16:07:03 Chris Withers wrote: > svilen wrote: > > search the group for things related to migrate (i call it migrene > > :); there are 2 approaches: > > - make the db match the py-model > > - make the model match the db > > It&#x

[sqlalchemy] some error at v4070

2008-02-11 Thread svilen
et' The case is somewhat strange but is working before that - a polymorphic union of concrete inheritances where the root-table is not included in the union (i.e. leafs only). If it gets included, the error goes away. i dont know, if it's the case that is too weird, i could workarou

[sqlalchemy] Re: building mappers for an existing database

2008-02-08 Thread svilen
On Friday 08 February 2008 16:09:28 Chris Withers wrote: > Hi All, > > Almost similar to my last question, how do you go about building > mappers for an existing database schema? > > What happens if you don't get it quite right? :-S > > cheers, > > Chris search the group for things related to mig

[sqlalchemy] Re: Search in object list by field value

2008-02-08 Thread svilen
On Friday 08 February 2008 14:26:04 maxi wrote: a) let SQl do it p1 = session.query(Person).filter_by(id==123).first() #see .filter_by syntax b) get all people, then plain python: for p in people: if p.id == 123: break else: p=None --~--~-~--~~~---~--~~ You

[sqlalchemy] Re: How to accomplish setup/run-app/teardown with mapped classes and sessions?

2008-01-23 Thread svilen
stored as class.__init (in orm.attributes.register_class) and is not cleared in clearmappers. for easy check, u can run your test 100 times and watch the memory used; if it grows then _something_ of all those above is not cleared. ciao svilen On Thursday 24 January 2008 00:00:52 Kumar McMi

[sqlalchemy] Re: eagerloading polymorphic mapper

2008-01-15 Thread svilen
On Tuesday 15 January 2008 17:19:49 Michael Bayer wrote: > On Jan 15, 2008, at 4:33 AM, svilen wrote: > > also, i dont see a reason for it not to work if the (A jon B join > > C) is a polymunion - all the same, all columns will be present > > there, having None where m

[sqlalchemy] Re: eagerloading polymorphic mapper

2008-01-15 Thread svilen
, having None where missing. 0.4.3? On Monday 14 January 2008 18:56:16 svilen wrote: > On Monday 14 January 2008 18:35:40 Michael Bayer wrote: > > On Jan 14, 2008, at 11:29 AM, svilen wrote: > > > On Monday 14 January 2008 17:19:14 Michael Bayer wrote: > > >> On Jan 14,

[sqlalchemy] Re: eagerloading polymorphic mapper

2008-01-14 Thread svilen
On Monday 14 January 2008 18:35:40 Michael Bayer wrote: > On Jan 14, 2008, at 11:29 AM, svilen wrote: > > On Monday 14 January 2008 17:19:14 Michael Bayer wrote: > >> On Jan 14, 2008, at 8:41 AM, svilen wrote: > >>> i have, say, base class A, inherited by two ch

[sqlalchemy] Re: eagerloading polymorphic mapper

2008-01-14 Thread svilen
On Monday 14 January 2008 17:19:14 Michael Bayer wrote: > On Jan 14, 2008, at 8:41 AM, svilen wrote: > > i have, say, base class A, inherited by two children B and C. B > > has an attribute/relation 'address', A and C do not have it. > > So i had a query(A).eagerloa

[sqlalchemy] Re: Query object behavior for methods all() and one()

2008-01-14 Thread svilen
all() returns whatwever is there, 0, 1, n first() returns first if any or None one() asserts there's exactly 1 On Monday 14 January 2008 18:23:28 Adrian wrote: > I am a bit confused by the behavior for the methods all() and one() > if the Query would return an empty result set. In the case of all

[sqlalchemy] eagerloading polymorphic mapper

2008-01-14 Thread svilen
i have, say, base class A, inherited by two children B and C. B has an attribute/relation 'address', A and C do not have it. So i had a query(A).eagerload( 'address') and that did work before r3912. But later it gives an error - "mapper|A has no property 'address'". Any hint how to do it now?

[sqlalchemy] Re: filter() on inherited class doesn't point to the correct table

2008-01-11 Thread svilen
On Friday 11 January 2008 17:03:06 Alexandre Conrad wrote: > svilen wrote: > > On Friday 11 January 2008 16:12:08 Alexandre Conrad wrote: > >>Channel -> Playlist -> Media > >>Channel -> CatalogChannel(Catalog) -> Media > >> > >>(Media has

[sqlalchemy] Re: filter() on inherited class doesn't point to the correct table

2008-01-11 Thread svilen
On Friday 11 January 2008 16:12:08 Alexandre Conrad wrote: > svilen wrote: > >>Here is the syntax followed by the generated query: > >> > >> query.filter(Catalog.c.id==CatalogChannel.c.id) > >> WHERE catalogs.id = catalogs.id > > > &g

[sqlalchemy] Re: filter() on inherited class doesn't point to the correct table

2008-01-11 Thread svilen
On Friday 11 January 2008 13:58:34 Alexandre Conrad wrote: > Hi, > > playing with inheritance, I figured out that an inherited mapped > class passed to filter doesn't point to the correct table. > > I have 2 classes, Catalog and CatalogChannel(Catalog). > > Here is the syntax followed by the gener

[sqlalchemy] String -> Text type deprecation

2008-01-09 Thread svilen
what it is about? i'm not much into sql types... isn't Varchar enough for a unsized/anysized String? btw, 'count * from ...' produces the warning for sqlite; a bindparam autoguesses a type_ of VARCHAR and for some reason the VARCHAR also needs length ?? --~--~-~--~~~-

[sqlalchemy] Re: get related table object via mapped class

2008-01-04 Thread svilen
On Friday 04 January 2008 18:54:29 Alexandre da Silva wrote: > Hello all, > > is there any way to access class related by an relationship? > > sample: > > # Table definition ommited > > class Person(object): > pass > > class Address(object): > pass > > mapper(Person, person_table, > pr

[sqlalchemy] Re: Emptying out the session of new objects

2008-01-04 Thread svilen
On Friday 04 January 2008 14:44:32 Dave Harrison wrote: > On Friday 04 January 2008 23:32:21 Alexandre da Silva wrote: > > > Is there an easy way of flushing all objects that are > > > categorised as new in the session ?? > > > > I think you can use session.clear(), it will remove objects from > >

[sqlalchemy] Re: query.filter_or() ?

2007-12-20 Thread svilen
expressions translator i found that i am duplicating code that is already there in the Query, doing same thing in slightly different angle) > On Dec 20, 2007 5:14 AM, svilen <[EMAIL PROTECTED]> wrote: > > query.filter() does criterion = criterion & new > > why not having

[sqlalchemy] query.filter_or() ?

2007-12-20 Thread svilen
query.filter() does criterion = criterion & new why not having one that does criterion = criterion | new ? its useful to have some query.this.that.filter.whatever.filter_or(...) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Googl

[sqlalchemy] Re: Conventions for creating SQL alchemy apps

2007-12-20 Thread svilen
some may-be-stupid answers: - see the number of lines per file - split it into app-field-related parts, not SA-arhitectural parts - hell, do as it is easier - start as one file, once u hit some limit of your nerve(r)s, split.. but do keep one single file as main entrance point On Thursday 20

[sqlalchemy] some error around trunk

2007-12-15 Thread svilen
seems something about .type vs .type_ or similar: Traceback (most recent call last): File "tests/convertertest.py", line 152, in test4_balance_trans_via_prev_balance_date_subselect trans.c.date > func.coalesce( sprev,0 ) File "sqlalchemy/sql/expression.py", line 777, in __call__ retu

[sqlalchemy] Re: Column defaults in MapperExtension.after_insert

2007-12-11 Thread svilen
> This works nicely for attributes that I set directly. However, it > breaks when it comes across a column that is defined as: > > sa.Column('date_created', sa.DateTime, > default=sa.func.current_timestamp(type=sa.DateTime)) > > The attached script should show the problem. The tr

[sqlalchemy] Re: Iterating over mapped properties

2007-12-11 Thread svilen
On Tuesday 11 December 2007 13:13:37 King Simon-NFHD78 wrote: > Hi, > > I used to be able to iterate over mapper.properties.items() to get > the name of each mapped property along with the object that > implements it. However, in 0.4.1, trying to do this results in a > NotImplementedError telling

[sqlalchemy] Re: Design: mapped objects everywhere?

2007-12-10 Thread svilen
On Monday 10 December 2007 12:12:19 Paul-Michael Agapow wrote: > Yowser. Thanks to both of you - that's exactly what I mean. Any > pointers on where I can find an example of a class that is > "unaware" if it is in the db? Or is there a good example of the > second solution, of "a single class tha

[sqlalchemy] Re: delete children of object w/o delete of object?

2007-12-06 Thread svilen
On Wednesday 05 December 2007 23:36:12 kris wrote: > with sqlalchemy 0.4.1, > > Is there an idiom for delete the children of the object > without actually deleting the object itself? > > I tried > session.delete (obj) > session.flush() > # add new children > session.save (obj) > session.flush() >

[sqlalchemy] clause with crossproduct of joined-inheritance

2007-11-26 Thread svilen
s a human to do it. can theses alises be somehow made automaticaly ? e.g. multiple access to same base table coming from different "subclasses" -> alias ciao svilen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

[sqlalchemy] Re: filter_by VS python properties/descriptors VS composite properties

2007-11-20 Thread svilen
On Tuesday 20 November 2007 11:37:29 Gaetan de Menten wrote: > Hi people, > > I have some classes with "standard python" properties which target > another python object and also uses several columns in the > database. I also got a global factory function to create an > instance of that target obje

[sqlalchemy] Re: 2 questions

2007-11-13 Thread svilen
On Monday 12 November 2007 23:11:25 Michael Bayer wrote: > On Nov 12, 2007, at 2:07 PM, [EMAIL PROTECTED] wrote: > > hi > > 1st one: i am saving some object; the mapperExtension of the > > object fires additional atomic updates of other things elsewhere > > (aggregator). > > These things has to b

[sqlalchemy] ticket 819/r3762

2007-11-13 Thread svilen
what a coincidence, 2 days ago we stepped on this bindparam-types thing; table.some_decimal_column == decimal.Decimal(5) did not always work. now it mostly works, i think there is one more case that breaks for me: when the column itself is hidden in a function. e.g. table_A = Table( 'Nalichnos

[sqlalchemy] Re: 2 questions

2007-11-13 Thread svilen
clarification for this below; i have non-ORM updates happening inside ORM transaction (in after_insert() etc). How to make them use the parent transaction? i have a connection there. > >> and, why atomic updates also have with commit after them? or is > >> this sqlite-specific? > > > > every CR

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-08 Thread svilen
> > i dont really understand why u need the ACP being so different to > > plain > > visitor; i mean cant they share some skeleton part of traversing, > > while > > putting all the choices (visit* vs convert; onentry/onexit; > > stop/dont) in their own parts. > > After all, visitor pattern is twofo

[sqlalchemy] Re: mapper/mapperExtension initialization order / mapper.properties

2007-11-08 Thread svilen
forget the instrument_class(). i do a separate MapExt, and append it to the mapper.extensions manualy. So if this post-mapper() append'ing does not screw things up, all else is ok. > i have another option to forget the above auto-approach and add the > extension separately, after the mapper(.

[sqlalchemy] mapper/mapperExtension initialization order / mapper.properties

2007-11-08 Thread svilen
g'day. in the Aggregator i have mapper extension, that needs info from the mapper like local-table and mapping/naming of column properties. It used to hook on instrument_class() for that, but now the mapper.properties in its new get()/iterate() form is not available yet when mapper-extensions a

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-07 Thread svilen
onEntry. if its too hard, i can probably traverse it twice, once just marking , 2nd time replaceing things? i'll try On Wednesday 07 November 2007 20:02:05 svilen wrote: > On Wednesday 07 November 2007 19:33:22 Michael Bayer wrote: > > ohyoure *extending* abstractclauseprocessor ??

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-07 Thread svilen
of that element is not traversed anymore (not ok)? > this new version of ACP can locate things besides just plain Table, > Alias and Column objects; it can locate things like Joins embedded > in a clause which match the target selectable. > > On Nov 7, 2007, at 10:45 AM, svilen wrote:

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-07 Thread svilen
ot; + result + "'") AssertionError: 'SELECT * FROM table1 WHERE table1.col1 = table2.col1' does not match 'SELECT * FROM table1 WHERE table1.col1 = table2.col1 AND table1.col2 = :table1_col2' here whole subexpr is gone On Wednesday 07 November 2007 17:45:04 svi

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-07 Thread svilen
d > Column movies.id > Column tags.oid > Column movies.id > Column users.id > Column userpics.uid > Column userpics.state the 2nd tags.tabl is missing, hence the assertFails ciao svilen --~--~-~--~~~---~--~~ You received this message beca

[sqlalchemy] Re: Code Organisation

2007-11-07 Thread svilen
u can use the timephase-separation, i.e. declare vs runtime; i.e. use global scope in for B in A, but use runtime scope for A in B. modB.py: import A ... modA.py: def somefunc_or_method(): import B ... another solution is to have sort-of forward-text-declarations that at certain t

[sqlalchemy] Re: r3681/ session.save( smth_persistent) became error?

2007-10-31 Thread svilen
On Wednesday 31 October 2007 17:51:09 Michael Bayer wrote: > also am considering taking save()/update()/save_or_update(), which > are hibernate terms, into just "add()". maybe ill put that in > 0.4.1. why not save() - having the 'save_or_update' meaning? would anyone need the new explicit save()

[sqlalchemy] r3681/ session.save( smth_persistent) became error?

2007-10-31 Thread svilen
why is this so? i have bunch of objects, and i make them all persistent. then i have another bunch, some of them are noe, other are from above and i want this bunch to also became persistent. (If something there IS already persistent - so what, do nothing) how do i do it now? --~--~-~--

[sqlalchemy] couple of errors

2007-10-26 Thread svilen
, in setup     self._get_context_strategy(querycontext).setup_query(querycontext, **kwargs)   File "sqlalchemy/orm/strategies.py", line 553, in setup_query     value.setup(context, parentclauses=clauses, parentmapper=self.select_mapper) ... last two repeated ... ciao svilen --~--

[sqlalchemy] weird case of bindparam confilct

2007-09-18 Thread svilen
this conflicts with above. i know i can rename all me-made bindparams, or prefix or something, but why is the (longer) key being mangled with count, while (shorter) shortname is directly put as is and not mangled too? ciao svilen --~--~-~--~~~---~--~~ You received

[sqlalchemy] Re: Feature suggestion: Description attribute in Tables/Columns

2007-09-17 Thread svilen
, and they already know their (DB) names. Thus u can have different layout of your documentation than what is in the source code. svilen On Monday 17 September 2007 16:07:15 Hermann Himmelbauer wrote: > Hi, > I am creating my database via SQLAlchemy, therefore I use several > "Column

[sqlalchemy] Re: Automatically loading data into objects

2007-09-14 Thread svilen
On Friday 14 September 2007 14:41:14 Hermann Himmelbauer wrote: > Hi, > In one of my database tables I have a varchar that is mapped to an > object with a string attribute. This specific varchar should > however be represented by a certain Python object, therefore it > would be very handy, if ther

[sqlalchemy] Re: Why is explicit 'and_' required for filter but not filter_by?

2007-09-14 Thread svilen
On Thursday 13 September 2007 22:54:25 Ryan Fugger wrote: > In 0.4: Is there any reason that I (as far as i can tell) need an > explicit 'and_' to use multiple parameters with Query.filter, as > opposed to filter_by, where I don't need an explicit 'and_'? I > think the latter is cleaner. becase f

[sqlalchemy] Re: Many-to-Many, Column not available

2007-09-11 Thread svilen
wild guess: do u need relations_table.id? rename/remove it On Tuesday 11 September 2007 12:34:47 KyleJ wrote: > I get the same result with this in 0.3.10 and 0.4beta5 > > Basic idea: I have two tables which hold various data and a third > table which let's different rows in each table be rela

[sqlalchemy] Re: How to safely increasing a numeric value via SQLAlchemy

2007-09-11 Thread svilen
On Tuesday 11 September 2007 13:35:18 Hermann Himmelbauer wrote: > Am Dienstag, 11. September 2007 10:54 schrieb svilen: > > in 0.4 there is atomic update, e.g. update set a=expression > > > > syntax is something like > > table.update( values=dict-of-name-expression )

[sqlalchemy] Re: How to safely increasing a numeric value via SQLAlchemy

2007-09-11 Thread svilen
in 0.4 there is atomic update, e.g. update set a=expression syntax is something like table.update( values=dict-of-name-expression ).execute( **bindings-if-any) expressions is whatever sa sql expression On Tuesday 11 September 2007 09:25:46 Hermann Himmelbauer wrote: > Hi, > I need to safely

[sqlalchemy] Re: add condition over a classmethod

2007-09-10 Thread svilen
somethings' missing here.. whats the link classmethod - select - etc? do explain again/more... u mean the classmethod generates the filter-expression? whats the difference classmethod vs plainmethod here? all the same, just call it: self.myclassmethod(..) On Monday 10 September 2007 14:40:57 Glau

[sqlalchemy] _state and related

2007-09-10 Thread svilen
pectations/limitations are documented somewhere. Another one is the ._instance_key that stays on the instance after orm is gone (the ._state will also stay). ciao svilen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups &

[sqlalchemy] Re: Many tables in eagerloading

2007-09-04 Thread svilen
On Tuesday 04 September 2007 17:12:26 Arun Kumar PG wrote: > Good work svilan! > > couple questions from what you suggested: > >> skipping creation of objects - only using the data, if time of > >> creation gets critical. > In my query wherein the eagerloading is being done on 8 tables if I > manu

[sqlalchemy] Re: Many tables in eagerloading

2007-09-04 Thread svilen
more of these invented, unless someone does it first, which would be very welcome... ciao svilen On Tuesday 04 September 2007 09:56:49 Arun Kumar PG wrote: > Guys, > > Was wondering if we have 10 tables or so which are related to each > other and are required during let's say report

[sqlalchemy] Re: How to construct a dialect-aware user type

2007-08-30 Thread svilen
IMO current way as of src (sorry i havent read docs at user level), u'll need two-side implementaion - one abstract SA, and one dialect-dependent. In each dialect, there are 2 mappings: one abstractSAtype->specificDialectType (look for something named colspecs), and another one used for reflec

[sqlalchemy] Re: interface error with Decimal("0") in where clause

2007-08-24 Thread svilen
e an option in all cases particularly when you are > storing amounts for accounting books... > > Florent. > > On 8/24/07, svilen <[EMAIL PROTECTED]> wrote: > > decimals.. u can use pickling? slower, yes. --~--~-~--~~~---~--~~ You recei

[sqlalchemy] Re: interface error with Decimal("0") in where clause

2007-08-24 Thread svilen
decimals.. u can use pickling? slower, yes. On Friday 24 August 2007 10:37:53 Florent Aide wrote: > Hi, > > As far as I know, sqlite does not allow you to store decimal > objects, only floats. Which really is not the same. If you really > need decimals (ie: accounting books anyone ?) then you sho

[sqlalchemy] Re: echo-es

2007-08-22 Thread svilen
> Another thing, the dots that are produced by unittests magically > disappear if meta.bind.echo = True, very interesting.. shoot me, thats my problem --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy" grou

[sqlalchemy] echo-es

2007-08-22 Thread svilen
in 0.3, one could do meta = MetaData( whatever, echo=True) later, early 0.4, the echo kwarg was gone, so it got less convenient, adding another line: meta.bind.echo = True As of latest trunk, neither works, one has to explicitly do meta = MetaData( create_engine(whatever, echo=True)) which is

[sqlalchemy] dbcook updated for SA 0.4

2007-08-21 Thread svilen
_BinaryExpression sqlalchemy.sql._BinaryExpression ''',1 ) (some of my usages date back to 0.3.6... i still keep them all) The migration was not very easy thing, as dbcook uses a_lot of under-cover internalities from SA. svn co https://dbcook.svn.sourceforge.n

[sqlalchemy] Re: overriding collection methods

2007-08-20 Thread svilen
On Monday 20 August 2007 18:01:49 jason kirtland wrote: > svilen wrote: > > a suggestion about _list_decorators() and similar. > > they can be easily made into classes, i.e. non dynamic (and > > overloadable/patchable :-). > > The stdlib decorators end up in a stat

[sqlalchemy] Re: overriding collection methods

2007-08-20 Thread svilen
On Monday 20 August 2007 17:29:52 jason kirtland wrote: > [EMAIL PROTECTED] wrote: > > hi > > i need to have a list collection with list.appender (in SA 0.4 > > terms) that accepts either one positional arg as the value, or > > keyword args which it uses to create the value. Each collection > > in

[sqlalchemy] Re: overriding collection methods

2007-08-20 Thread svilen
and no need for that __new__ replacement either - just use _list_decorators._funcs instead of _list_decorators() On Monday 20 August 2007 17:05:32 svilen wrote: > a patch, it got even tidier ;-) - > no more _tidy() calls, all automated. > > On Monday 20 August 2007 16:41:30 svilen

[sqlalchemy] Re: overriding collection methods

2007-08-20 Thread svilen
a patch, it got even tidier ;-) - no more _tidy() calls, all automated. On Monday 20 August 2007 16:41:30 svilen wrote: > a suggestion about _list_decorators() and similar. > they can be easily made into classes, i.e. non dynamic (and > overloadable/patchable :-). > > class _

[sqlalchemy] Re: overriding collection methods

2007-08-20 Thread svilen
.pop(s) return r _def _tidy(fn): ... #becomes global the only prerequisite for this is to rename __del() and __set() into _del /_set or else they get looked up as private-named identifiers (?? no idea why). ciao svilen --~--~-~--~~~---~--~~ You received

[sqlalchemy] Re: overriding collection methods

2007-08-20 Thread svilen
another thing noted, the collections instrumentation fails over old python classes (not inheriting object), e.g. class myX: ...whatever... it fails at _instrument_class(), because type(myX()) being is recognized as builtin, and apart of that the util.duck_type_collection() may fail because i

[sqlalchemy] query.select vs .filter + .from_statement

2007-08-16 Thread svilen
i have a premade filtering clause and give it to a query.select at runtime. Sometimes its a simple x == 13 expression, another time it is a full sql-construct like polymorphic_union(). in 0.3 all went into .select(), but in 0.4 these 2 kinds seems split between .from_statement and .filter. so

[sqlalchemy] Re: SQLAlchemy 0.4 beta2 released

2007-08-14 Thread svilen
performance-wise - do u have any test/target for profiling? else i can repeat some tests i did somewhen in february (if i remember them..) = while looking to replace all {} with dict/Dict(), i found some things. Here the list, quite random, probably some can be just ignored if not an

[sqlalchemy] Re: a renaming proposal

2007-07-27 Thread svilen
On Friday 27 July 2007 18:14:48 Michael Bayer wrote: > On Jul 27, 2007, at 6:29 AM, avdd wrote: > > On Jul 27, 9:45 am, jason kirtland <[EMAIL PROTECTED]> wrote: > >> This is the last opportunity > >> for terminology changes for a while, so I offer this up for > >> discussion. > > > > Does anyone

[sqlalchemy] Re: SQLAlchemy 0.4 MERGED TO TRUNK

2007-07-27 Thread svilen
here the changes i needed to get dbcook (abstraction layer over SA), and its tests going to some extent (70% - relations and expressions are broken): - BoundMetaData -> MetaData - lots (15) - metadata.engine.echo=True - lots (14) Whats the difference between create_engine's echo=boolean and M

[sqlalchemy] Re: not updated relation one-to-many

2007-07-27 Thread svilen
i think u should not make 2 separate relations, but one relation on one of the tables, with a backref to the other. i.e. just mapper( T1, t1, properties={"t2s": relation(T2, lazy=False, backref='t1')}) do check doco, just in case. On Friday 27 July 2007 15:07:39 Michal Nowikowski wrote: > Hel

[sqlalchemy] Re: SQLAlchemy 0.4 MERGED TO TRUNK

2007-07-27 Thread svilen
one suggesstion / request. As your changing everything anyway, can u replace all important {} and dict() with some util.Dict, and set() with util.Set? util.Ones can point to dict/set. The reason is so they can be further globally replaced by user with OrderedOnes, for example to achieve repeat

[sqlalchemy] Re: autoload'ing metadata

2007-07-27 Thread svilen
On Friday 27 July 2007 12:44:49 Christophe de VIENNE wrote: > 2007/7/26, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > 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'

[sqlalchemy] Re: a renaming proposal

2007-07-27 Thread svilen
On Friday 27 July 2007 11:44:43 Gaetan de Menten wrote: > On 7/27/07, svilen <[EMAIL PROTECTED]> wrote: > > On Friday 27 July 2007 02:45:12 jason kirtland wrote: > > > > - Catalog: > > what is a sqlalchemy's metadata? > > > > >jason> "

[sqlalchemy] Re: a renaming proposal

2007-07-27 Thread svilen
On Friday 27 July 2007 02:45:12 jason kirtland wrote: > So there you have it. I'm not married to this proposal by *any* > means. The ideas gelled in my brain during the SQLAlchemy tutorial > at OSCON, and this seems like the last opportunity to deeply > question and reconsider what we have before

[sqlalchemy] Re: autoload'ing metadata

2007-07-26 Thread svilen
On Thursday 26 July 2007 11:37:08 Marco Mariani wrote: > [EMAIL PROTECTED] ha scritto: > > 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_Tr > >ee_Comparison_Approach_to_Detect.pdf > >

[sqlalchemy] Re: autoload'ing metadata

2007-07-25 Thread svilen
copying the structure of input db1 database into the output db2. ciao svilen > this is along the recent threads about metadata consistency between > code and DB, and the DB-migration. Both these require a full > metadata reflection from database. > > Here a version of autocode.py, hacke

[sqlalchemy] Re: Choosing a few columns out a query object

2007-07-25 Thread svilen
> from sqlalchemy import * > > metadata = MetaData() > docs = Table('docs', metadata) > docs.append_column(Column('DocID', Integer, primary_key=True)) > docs.append_column(Column('Path', String(120))) > docs.append_column(Column('Complete', Boolean)) > > class Doc(object): > def __init__(self,

[sqlalchemy] Re: Choosing a few columns out a query object

2007-07-25 Thread svilen
On Wednesday 25 July 2007 15:01:59 alex.schenkman wrote: > Hello: > > How do I get only a few columns from a query object? > > q = session.query(Document).select_by(Complete=False) > > would give me a list of rows (all columns) where Complete == False. this would give u a list of objects, not rows

[sqlalchemy] autoload'ing metadata

2007-07-25 Thread svilen
this is along the recent threads about metadata consistency between code and DB, and the DB-migration. Both these require a full metadata reflection from database. Here a version of autocode.py, hacked for couple of hours. It has more systematic approach, replaces back column types with SA on

[sqlalchemy] Re: Consistency with DB while modifying metadata

2007-07-24 Thread svilen
> i just saw there is some usagerecipe ModelUpdate in the wiki, may > be a good start point: > http://www.sqlalchemy.org/trac/wiki/UsageRecipes/ModelUpdate > and this one: http://www.sqlalchemy.org/trac/wiki/UsageRecipes/AutoCode --~--~-~--~~~---~--~~ You received

[sqlalchemy] Re: Consistency with DB while modifying metadata

2007-07-24 Thread svilen
i just saw there is some usagerecipe ModelUpdate in the wiki, may be a good start point: http://www.sqlalchemy.org/trac/wiki/UsageRecipes/ModelUpdate > > >> assert t.compare(t2) > > > > > > yes i was hoping for such method (:-) > > > And the best will be if it can produce a list/ hierarchy of >

[sqlalchemy] Re: Consistency with DB while modifying metadata

2007-07-24 Thread svilen
> >> assert t.compare(t2) > > > > yes i was hoping for such method (:-) > > And the best will be if it can produce a list/ hierarchy of > > differences, which then programaticaly can be iterated - and > > checked and resolved or raised higher. > > > >> but why not just use autoload=True across the

[sqlalchemy] Re: Consistency with DB while modifying metadata

2007-07-24 Thread svilen
On Tuesday 24 July 2007 17:30:27 Michael Bayer wrote: > > such a feature would make usage of table reflection, and then a > comparison operation, along the lines of : > > ... > > assert t.compare(t2) yes i was hoping for such method (:-) And the best will be if it can produce a list/ hierarchy of

[sqlalchemy] Re: Consistency with DB while modifying metadata

2007-07-24 Thread svilen
On Tuesday 24 July 2007 16:22:43 Anton V. Belyaev wrote: > Hey, > > I believe there is a common approach to the situation, but I just > dont know it. > > Let say, I have some tables created in the DB using SQLAlchemy. > Then I modify Python code, which describes the table (add a column, > remove a

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

2007-07-23 Thread svilen
> First, I appended the sys.path var like this (relative, was > absolute before): > sys.path.append( 'vor') IMO u should not touch sys.path unless u really really have no other chance. Although this above is another wholesale solution to your initial problem (and no need of my_imports et

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

2007-07-23 Thread svilen
> 1: At least I'm in a working context...since I will be the user of > this jobs module 90% of the time for a while, I'll have a fighting > chance of refining it further to handle the other things you allude > to. have fun then. As for the $100... give them to someone in _need_ (the mall is not i

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

2007-07-23 Thread svilen
On Monday 23 July 2007 17:52:51 Jesse James wrote: > > aaah, u are _that_ new... > > - use it instead of the __import__() func > > - original python library reference of the version u use; > > e.g.http://docs.python.org/lib/built-in-funcs.html > > > > wow there's a level parameter now... somethi

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

2007-07-23 Thread svilen
On Monday 23 July 2007 16:45:15 Jesse James wrote: > which python reference (url?) are you speaking of? > how does 'import_fullname' work? how would it be applied? aaah, u are _that_ new... - use it instead of the __import__() func - original python library reference of the version u use; e.g.

[sqlalchemy] Re: doing a one() on a unique key

2007-07-20 Thread svilen
i think there was .one() to return one and only one and die otherwise i.e. match {1}, and first() or similar that allows match {0,1}. On Friday 20 July 2007 18:42:56 Marco De Felice wrote: > Hi all for my first post > I'm using the new one() method like this: > > query(Table).filter_by(and_(Tab

[sqlalchemy] Re: dbcook 0.1

2007-07-19 Thread svilen
> Isn't it what does already Elixir? not really. Frankly, i dont know much elixir, just some impressions. elixir is sort of syntax sugar over SA, with very little decision-making inside. It leaves all the decisions - the routine ones too - to the programmer. At least thats how i got it. This on

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

2007-07-17 Thread svilen
On Tuesday 17 July 2007 18:01:12 Michael Bayer wrote: > > 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

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

2007-07-17 Thread svilen
well, i'm using them NPs just to have another (simpler) select_table. otherwise anything query through primary_mapper starts off its own select_table, which can be rather huge in my case. if u can make the a query( primary_mapper, select_table) somehow possible... i won't need separate NPs. Note

[sqlalchemy] Re: Bug? Polymorphic inheritance 100 times slower

2007-07-16 Thread svilen
On Monday 16 July 2007 17:08:08 Michael Bayer wrote: > On Jul 16, 2007, at 2:59 AM, Yves-Eric wrote: > > Thanks for the explanation! The root of the issue is now very > > clear. But are you saying that this is intended behavior? Was I > > wrong in trying to use the session as an object cache? > >

[sqlalchemy] Re: SQLAlchemy 0.3.9 Released

2007-07-16 Thread svilen
On Monday 16 July 2007 17:18:04 Michael Bayer wrote: > On Jul 16, 2007, at 10:12 AM, svilen wrote: > > On Monday 16 July 2007 16:54:01 Michael Bayer wrote: > >> On Jul 16, 2007, at 9:20 AM, svilen wrote: > >>> on the "generative" line: > >>> - h

[sqlalchemy] Re: SQLAlchemy 0.3.9 Released

2007-07-16 Thread svilen
On Monday 16 July 2007 16:54:01 Michael Bayer wrote: > On Jul 16, 2007, at 9:20 AM, svilen wrote: > > on the "generative" line: > > - how would i prepack a select (or some other filtering) and give > > it to a query() _later_? > > e.g. i have some table.c.typ

[sqlalchemy] Re: SQLAlchemy 0.3.9 Released

2007-07-16 Thread svilen
on the "generative" line: - how would i prepack a select (or some other filtering) and give it to a query() _later_? e.g. i have some table.c.type == 'person', and i want to apply to several queries? i can store the expression, doing query.select(expr) each time. Any other way? e.g. store a sele

  1   2   3   >