[sqlalchemy] Re: Can't connect to SQLite databases

2017-06-20 Thread python howto
On Saturday, October 22, 2011 at 7:03:59 AM UTC-4, João Silva wrote: > > Hello everyone, > > I'm having a problem connecting to SQLite database files with > SQLAlchemy. :memory: databases work just fine, but whenever I'm trying > to access a file, the following happens: > > > Python 2.7.2

[sqlalchemy] increasing memory on simple query

2017-06-20 Thread Luca Zulian
Hi, I am currently playing around with SQLAlchemy a bit, and I found a strange behaviour about memory usage. I'm using sqlalchemy with version 1.1.10 running on python 2.7.13 # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from contextlib import

Re: [sqlalchemy] Re: ImportError: cannot import name postgresql

2017-06-20 Thread mike bayer
it seems likely that your apache server is using a different Python path / virtualenv and you need to have SQLAlchemy installed in that environment. On 06/20/2017 12:53 AM, shrey.chau...@invicto.in wrote: this is the stack trace : [Mon Jun 19 18:11:01.431528 2017] [:error] [pid 18592] [remote

Re: [sqlalchemy] Is this a valid inheritance configuration ?

2017-06-20 Thread yoch . melka
Thank you Mike ! Le mardi 20 juin 2017 21:23:01 UTC+3, Mike Bayer a écrit : > > > > On 06/20/2017 02:08 PM, yoch@gmail.com wrote: > > Hi, > > > > I wish to have a two-levels inheritance, but I don't know how to > proceed. > > The docs says that "only one discriminator column or SQL

[sqlalchemy] Re: Only return single entity from query

2017-06-20 Thread Ryan Weinstein
On Monday, June 19, 2017 at 6:40:04 PM UTC-7, Jonathan Vanasco wrote: > > You're not joining anything onto the `rProductCategoryHistory` table, so > depending on your DB you may be getting populated rows for rProduct that > don't match anything. > > you probably want something like this... > >

Re: [sqlalchemy] Re: Only return single entity from query

2017-06-20 Thread Ryan Weinstein
Thanks for the reply Mike. SQLAlchemy is a fantastic ORM and you've done an amazing job with it. You're suggestion hasn't fixed my issue though, perhaps there's something fundamental I'm misunderstanding? Here is the query I'm testing: r_product_category_history_list =

[sqlalchemy] Re: Only return single entity from query

2017-06-20 Thread Ryan Weinstein
On Tuesday, June 20, 2017 at 9:53:10 AM UTC-7, Jonathan Vanasco wrote: > > you're almost there. > > flip a few lines around to rewrite the query to select from product... > e.g. something like > > SELECT r_product_list.* FROM r_product_list > JOIN r_product_category_history_list on >

[sqlalchemy] Re: Only return single entity from query

2017-06-20 Thread Ryan Weinstein
On Tuesday, June 20, 2017 at 9:53:10 AM UTC-7, Jonathan Vanasco wrote: > > you're almost there. > > flip a few lines around to rewrite the query to select from product... > e.g. something like > > SELECT r_product_list.* FROM r_product_list > JOIN r_product_category_history_list on >

Re: [sqlalchemy] Re: Only return single entity from query

2017-06-20 Thread mike bayer
On 06/20/2017 01:04 PM, Ryan Weinstein wrote: On Tuesday, June 20, 2017 at 9:53:10 AM UTC-7, Jonathan Vanasco wrote: you're almost there. flip a few lines around to rewrite the query to select from product... e.g. something like SELECT r_product_list.* FROM r_product_list

[sqlalchemy] Re: Only return single entity from query

2017-06-20 Thread Jonathan Vanasco
you're almost there. flip a few lines around to rewrite the query to select from product... e.g. something like SELECT r_product_list.* FROM r_product_list JOIN r_product_category_history_list on r_product_list.r_id=r_product_category_history_list.r_id JOIN

[sqlalchemy] Is this a valid inheritance configuration ?

2017-06-20 Thread yoch . melka
Hi, I wish to have a two-levels inheritance, but I don't know how to proceed. The docs says that "only one discriminator column or SQL expression may be configured for the entire inheritance hierarchy". I tried with this example (mixing joined and single inheritances) : class Person(Base):

Re: [sqlalchemy] Is this a valid inheritance configuration ?

2017-06-20 Thread mike bayer
On 06/20/2017 02:08 PM, yoch.me...@gmail.com wrote: Hi, I wish to have a two-levels inheritance, but I don't know how to proceed. The docs says that "only one discriminator column or SQL expression may be configured for the entire inheritance hierarchy". I tried with this example (mixing

Re: [sqlalchemy] Re: Only return single entity from query

2017-06-20 Thread mike bayer
You'd need to turn on echo='debug' on create_engine() and look at the rows actually being sent to see what's happening. On 06/20/2017 01:59 PM, Ryan Weinstein wrote: Thanks for the reply Mike. SQLAlchemy is a fantastic ORM and you've done an amazing job with it. You're suggestion hasn't