[sqlalchemy] hacking,anti-hacking,registry tweaks,compter tricks
check this out buddies. kool website for: * hacking and anti hacking tricks * anti hackng tricks. * registry tweaks * orkut tricks * small virus * computer tricks and loads of different tricks... www.realm-of-tricks.blogspot.com www.registrydecoded.blogspot.com --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] bug .. ?
Hello, I've a small problem, I try to translate this SQL query : http://dpaste.com/20579/ into an SQLAlchemy query : http://dpaste.com/20580/ However, I get the following error : group_by = [t_specimens.c.taxonomy_id] Module sqlalchemy.sql:3009 in label def label(self, name): if not self.is_scalar: raise exceptions.InvalidRequestError(Not a scalar select statement) else: return label(name, self) raise exceptions.InvalidRequestError(Not a scalar select statement) sqlalchemy.exceptions.InvalidRequestError: Not a scalar select statement I tried to add a scalar = True to the q_specimens select but it doesn't work and I get another error (exceptions.AttributeError: '_Label' object has no attribute 'corresponding_column') ... (Normally a scalar = True is not needed in this case ..) Any idea what I did wrong ? In advance thanks, Julien -- Julien Cigar Belgian Biodiversity Platform http://www.biodiversity.be Université Libre de Bruxelles (ULB) Campus de la Plaine CP 257 Bâtiment NO, Bureau 4 N4 115C (Niveau 4) Boulevard du Triomphe, entrée ULB 2 B-1050 Bruxelles Mail: [EMAIL PROTECTED] Tel : 02 650 57 52 --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: bug .. ?
ok, forgot my message ... I used .label() instead of .alias() :O On Tue, 2007-09-25 at 12:16 +0200, Julien Cigar wrote: Hello, I've a small problem, I try to translate this SQL query : http://dpaste.com/20579/ into an SQLAlchemy query : http://dpaste.com/20580/ However, I get the following error : group_by = [t_specimens.c.taxonomy_id] Module sqlalchemy.sql:3009 in label def label(self, name): if not self.is_scalar: raise exceptions.InvalidRequestError(Not a scalar select statement) else: return label(name, self) raise exceptions.InvalidRequestError(Not a scalar select statement) sqlalchemy.exceptions.InvalidRequestError: Not a scalar select statement I tried to add a scalar = True to the q_specimens select but it doesn't work and I get another error (exceptions.AttributeError: '_Label' object has no attribute 'corresponding_column') ... (Normally a scalar = True is not needed in this case ..) Any idea what I did wrong ? In advance thanks, Julien -- Julien Cigar Belgian Biodiversity Platform http://www.biodiversity.be Université Libre de Bruxelles (ULB) Campus de la Plaine CP 257 Bâtiment NO, Bureau 4 N4 115C (Niveau 4) Boulevard du Triomphe, entrée ULB 2 B-1050 Bruxelles Mail: [EMAIL PROTECTED] Tel : 02 650 57 52 --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Supporting sybase backend through mx.ODBC driver
Hi all, I was wondering if there is any development effort going on to support a sybase backend for sqlalchemy based on the mx.ODBC drivers from egenix (google didn't find anything and there was no relevant thread on this list) ? I'm currently caught in the run/debug/bug fix cycle on my first implementation while running the unit tests for such a backend. Anything I should be aware of ? cheers, alex --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: plain python objects from ORM
On Sep 24, 2007, at 10:43 PM, Huy Do wrote: Michael Bayer wrote: On Sep 24, 2007, at 11:48 AM, Huy Do wrote: Hi, Is it possible to get SA ORM to return plain python objects (with eagerloaded relations and all) but without any attribute instrumentation (or anything else magically added by SA). not really. unless you remove the instrumentation from the classes themselves afterwards (a one way operation). Any pointers on how to do this ? to the whole object hierachy. clear_mappers() of course you could argue that theres no technical reason the ORM shouldnt be able to do this. there could be some extremely specialized rewrite of attributes.py that could do it perhaps, but maintaining test coverage for that would be a whole project in itself Would a mapper extension allow me to do this ? not really. I think this would be a great feature to have because there are many use cases in my application (mainly displaying/processing tables) where I don't want/need the overhead of the instrumentation (and it really does add quite a bit), but would still love the excellent mapping abilities (i.e have fully hydrated domain objects rather then ResultProxy). I think theres still going to be a lot of overhead even without instrumentation. anyway, this would be an enormous amount of effort to establish and also to keep test coverage going, and would probably be a significant complication to the internals. Id rather focus on making our current, single approach faster and better (note that 0.4 uses about half the method call overhead of 0.3 for load operations). If you want, just create a rudimentary object creation layer over the normal SQL constructs. It would be more appropriate for this to be something entirely separate from the existing orm module. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: 0.4.0beta5 breaks [Oracle] query, works on 0.3.7 and with cxOracle
On Sep 24, 2007, at 11:36 PM, m h wrote: NP, I know Oracle is a drag but that's what the client has. Perhaps if you could clarify why I'm confused I might be able to help debug. (I've stepped through expression.py all day long). I feel like I just need a little hint or push in the right direction. Eventually you get to a cx cursor and call execute with the statement on it. How does the same statement/parameter combo fail with SQL generate, yet succeed using `text` or plain cx? If I can get over that hump, I think I might be able to give you a patch. my suspicion is that we are calling set_input_sizes on the cursor in the case of oracle. but im not sure (need to play with it). if you want to try unsetting that flag in the oracle dialect...(its called auto_setinputsizes or similar). --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: r3507 breaks here
On Sep 25, 2007, at 1:18 AM, [EMAIL PROTECTED] wrote: On Monday 24 September 2007 22:31:35 Michael Bayer wrote: On Sep 24, 2007, at 12:13 PM, [EMAIL PROTECTED] wrote: it something to do with that expects thing... just do a x = str(b) before session.clear(), breaks it all. OK...that was just a *great* way to spend all day tracking that one down. its fixed in 3515. I didn't bother to see why it doesn't exist in 0.3, but its confusing that it doesn't, since the basic mechanics of this one are present there as well, there must be some subtlety which conceals it. I hope you can find more insanely obscure bugs like this for me tomorrow ! now that u mentioned it... r3515 introduces something: File /home/az/src/dbcook/sqlalchemy/orm/query.py, line 619, in __iter__ return self._execute_and_instances(statement) File /home/az/src/dbcook/sqlalchemy/orm/query.py, line 624, in _execute_and_instances return iter(self.instances(result)) File /home/az/src/dbcook/sqlalchemy/orm/query.py, line 680, in instances self.select_mapper._instance(context, row, result) File /home/az/src/dbcook/sqlalchemy/orm/mapper.py, line 1360, in _instance discriminator = row[self.polymorphic_on] File /home/az/src/dbcook/sqlalchemy/engine/base.py, line 1590, in __getitem__ return self.__parent._get_col(self.__row, key) File /home/az/src/dbcook/sqlalchemy/engine/base.py, line 1394, in _get_col rec = self._key_cache[key] File /home/az/src/dbcook/sqlalchemy/util.py, line 72, in __missing__ self[key] = val = self.creator(key) File /home/az/src/dbcook/sqlalchemy/engine/base.py, line 1304, in lookup_key raise exceptions.NoSuchColumnError(Could not locate column in row for column '%s' % (str(key))) NoSuchColumnError: Could not locate column in row for column 'pu_a.atype' ? failed A.query_SUB_instances: Could not locate column in row for column 'pu_a.atype' pu_a is polymorphic union, and fails only if from_statement() is involved. yeah thats exactly the bug that was fixed. an Alias object now indicates to the ResultProxy to only match Column objects based on the exact labeled name of that column (which is normally tablename_columnname). maybe you can adjust your polymorphic_union and/or from_statement() to better match up. Theres possibly a way to make this work both ways (i.e. by only having eagerload aliases actually use this new flag, other kinds of aliases act the old way) but I want to see if you can work around it first. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: Supporting sybase backend through mx.ODBC driver
On Sep 25, 2007, at 8:04 AM, Alexander Houben wrote: Hi all, I was wondering if there is any development effort going on to support a sybase backend for sqlalchemy based on the mx.ODBC drivers from egenix (google didn't find anything and there was no relevant thread on this list) ? I'm currently caught in the run/debug/bug fix cycle on my first implementation while running the unit tests for such a backend. Anything I should be aware of ? we've had requests for a sybase backend and also I had some conversations with Marc Lemburg about working on a generic mx.ODBC backend, but that project seems to have died. So at this stage some new people would need to get involved for any of that to go forward. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: Supporting sybase backend through mx.ODBC driver
Michael Bayer wrote: On Sep 25, 2007, at 8:04 AM, Alexander Houben wrote: Hi all, I was wondering if there is any development effort going on to support a sybase backend for sqlalchemy based on the mx.ODBC drivers from egenix (google didn't find anything and there was no relevant thread on this list) ? I'm currently caught in the run/debug/bug fix cycle on my first implementation while running the unit tests for such a backend. Anything I should be aware of ? we've had requests for a sybase backend and also I had some conversations with Marc Lemburg about working on a generic mx.ODBC backend, but that project seems to have died. So at this stage some new people would need to get involved for any of that to go forward. Since I'm working on a customer project requesting such a backend I'll move forward then and continue with the implementation. thanks, alex --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] IntegrityError during query?
Hi, I have a newbie question: I'm parsing a log file in order to record login-times but I'm getting an IntegrityError on an insert during a query. Does this make sense? Even though I'm going a commit at the botton of the loop should I expect the INSERT to actually happen during a subsequent query? Thanks, Mark --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: plain python objects from ORM
I think this would be a great feature to have because there are many use cases in my application (mainly displaying/processing tables) where I don't want/need the overhead of the instrumentation (and it really does add quite a bit), but would still love the excellent mapping abilities (i.e have fully hydrated domain objects rather then ResultProxy). I think theres still going to be a lot of overhead even without instrumentation. anyway, this would be an enormous amount of effort to establish and also to keep test coverage going, and would probably be a significant complication to the internals. Id rather focus on making our current, single approach faster and better (note that 0.4 uses about half the method call overhead of 0.3 for load operations). fair enough. I think I'm just a big fan of the ORM load features, but not of the (cascading) flush (save/update/delete) features. I am a control freak when it comes to the database. There was a stage when I did not like the sql generated from the ORM load as well, but recently (not sure which version) the sql it generates is almost ;-) as good as the one i write by hand If you want, just create a rudimentary object creation layer over the normal SQL constructs. It would be more appropriate for this to be something entirely separate from the existing orm module. I was thinking along these lines. I am going to study your query.instances to get some hints Thanks for all the help. Huy --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: detect if objects have been deleted from a session?
Thanks for the quick response. On 9/24/07, Michael Bayer [EMAIL PROTECTED] wrote: but also i dont understand the problem you're having. the ConcurrentModificationError should only happen if you are issuing a literal DELETE statement to the database which conflicts with the session trying to delete the instance, or if you've already issued the delete and flushed in a session concurrent to the current one. yes, this was exactly what I was doing, whoops. When I changed it to only flush once I was painfully reminded that my regression suite was failing in mysterious ways because I didn't have any relation properties assigned to my mappers (it looked like the parent object wasn't getting saved). At the time I couldn't figure that out. Sigh. But, yes, putting flush in the right place made the newer code work :) Now I have what appears to more misconfigured mapper issues but those should be easy to find answers to. I'd just been staring at it all too long to notice the multiple flush calls. Thanks! -Kumar --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: 0.4.0beta5 breaks [Oracle] query, works on 0.3.7 and with cxOracle
Have updated the ticket with my fix change the dbapi_type of OracleText from CLOB to NUMBER I'm not sure if this breaks others code http://www.sqlalchemy.org/trac/ticket/793 --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---