[sqlalchemy] Re: Trying to query a relationship of a relationship

2011-06-09 Thread Jules Stevenson
I don't think the info I sent last night was particularly clear, apologies it was late. The code for the classes is below: # ArkClient - clientprojectshot module orm.mapper(ArkClient, clients_table, properties={    'contacts':orm.relation(ArkContact,            backref='client'),    

[sqlalchemy] Re: Trying to query a relationship of a relationship

2011-06-09 Thread Jules Stevenson
Sorry, for the spamming, code typo (was trying to simplify it), should read: invoices = query(ArkInvoice).\ join(ArkInvoice.project).\ join(ArkProject.client).\ options(sa.orm.contains_eager(ArkInvoice.project.client)).\

[sqlalchemy] Re: porting GeoAlchemy to 0.7

2011-06-09 Thread Eric Lemoine
On Mon, Jun 6, 2011 at 9:47 PM, Eric Lemoine eric.lemo...@camptocamp.com wrote: Hi i'm currently in the process of porting GeoAlchemy to SQLAlchemy 0.7. The first issue I'm having is related to before_create and after_create DDL listeners we have in GeoAlchemy. We use before_create and

[sqlalchemy] Re: Sqlalchemy beaker cache and memcached

2011-06-09 Thread Łukasz Czuja
Thank you for a quick response. It's much appreciated. Let me be more specific: 1. Do you use the code provided in the above link? If not how do cache and retrieve results via query.options() or cache.get() and then session.merge() ? 2. Do you use it in any framework like pylons or diango? 3. My

RE: [sqlalchemy] Re: Trying to query a relationship of a relationship

2011-06-09 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Jules Stevenson Sent: 09 June 2011 08:53 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: Trying to query a relationship of a relationship Sorry, for the spamming, code

RE: [sqlalchemy] Filtered backref

2011-06-09 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Joril Sent: 08 June 2011 22:41 To: sqlalchemy Subject: [sqlalchemy] Filtered backref Hi everyone! Is it possible to have a many-to-one declarative relation between two classes

[sqlalchemy] Re: Polymorphic forces table definition outside of declarative class?

2011-06-09 Thread Eric Ongerth
Good fix, thanks. And thanks for the first answer too, I had not thought of just using __table__.c.discriminator. I was thinking I would need to use sometable.c.discriminator, which I wasn't sure would work. Incidentally, I'm finally going to quit using inheritance for cross- cutting concerns

[sqlalchemy] Status of executed update

2011-06-09 Thread Martin
Hi, I have a question: Is it possible to get the information if an SQL Update was successful from the Result-Proxy returned from executing the update statement: result = connection.execute (update.where (pk_column == pk)) Thanks, Martin -- You received this message because you are

[sqlalchemy] grouping of a query results after select_all()

2011-06-09 Thread Eduardo
Dear Sirs, My problem is following as follows I have multiple of queries that I save in a list. When I have all my queires in the list I apply intersect_all method q=qlist[0].intersect_all(*qlist[1:]) I get my result simply by res=q.all() However I would like to group results according to some

Re: [sqlalchemy] Re: porting GeoAlchemy to 0.7

2011-06-09 Thread Michael Bayer
On Jun 9, 2011, at 3:57 AM, Eric Lemoine wrote: Hi Here's another issue with porting GeoAlchemy to SQLAlchemy 0.7. So GeoA defines a TypeEngine, which looks like this: class Geometry(TypeEngine): def __init__(self, dimension=2, srid=4326, spatial_index=True, **kwargs):

Re: [sqlalchemy] Re: porting GeoAlchemy to 0.7

2011-06-09 Thread Eric Lemoine
On Thu, Jun 9, 2011 at 6:28 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Jun 9, 2011, at 3:57 AM, Eric Lemoine wrote: Hi Here's another issue with porting GeoAlchemy to SQLAlchemy 0.7. So GeoA defines a TypeEngine, which looks like this: class Geometry(TypeEngine):    def

Re: [sqlalchemy] Re: porting GeoAlchemy to 0.7

2011-06-09 Thread Michael Bayer
On Jun 9, 2011, at 12:37 PM, Eric Lemoine wrote: On Thu, Jun 9, 2011 at 6:28 PM, Michael Bayer mike...@zzzcomputing.com wrote: That's the default adaption provided by TypeEngine.adapt().Provide your own adapt() that does what's needed. For examples see Interval, Enum. Ok, I'll

[sqlalchemy] Incorrect DDL generated for server_default

2011-06-09 Thread MikeCo
Server defaults appear to be handled incorrectly in some cases (looks like for string values) in versions 0.6 and 0.7. The code works in 0.5. I run into this with sqlite, and don't have access other databases right now. Test case (code below): 1. create a table with server side default value (I

Re: [sqlalchemy] Incorrect DDL generated for server_default

2011-06-09 Thread Michael Bayer
On Jun 9, 2011, at 5:10 PM, MikeCo wrote: This should recreate the same table, and will do so in 0.5. In 0.6 and 0.7 the default is rendered as DEFAULT A B without the single quote enclosing 'A B' leading to an OperationalError exception. The interesting thing is that if step 1 is done by

[sqlalchemy] Re: How to tweak pylint for SA models?

2011-06-09 Thread kris
Did you ever find a solution to this? I am facing the same issue. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/Rt3A6BJIeWIJ. To post to this group, send

Re: [sqlalchemy] Re: How to tweak pylint for SA models?

2011-06-09 Thread Michael Bayer
I would think using declarative would solve most of it as the attributes are defined explicitly on the class. On Jun 9, 2011, at 8:20 PM, kris wrote: Did you ever find a solution to this? I am facing the same issue. -- You received this message because you are subscribed to the

[sqlalchemy] Invitation to connect on LinkedIn

2011-06-09 Thread Ting Zhou
LinkedIn I'd like to add you to my professional network on LinkedIn. - Ting Ting Zhou Postdoc at University of Zurich Zürich Area, Switzerland Confirm that you know Ting Zhou https://www.linkedin.com/e/dxhyml-goqo1vgt-46/isd/3169879102/cAUkydte/ -- (c) 2011, LinkedIn