Hi,
I need to implement the storage of the neighborood of a place. I try to
use Declarative and relation to get this done but it sounds like I
missed something important I can not understand.
Here are my models:
neighbors_table = Table('neighbors', Base.metadata,
Column('shop_id',
Here is a primaryjoin, secondaryjoin I tried without success:
neighbors = relation(Place, primaryjoin=(Place.id ==
neighbors_table.place_id), secondaryjoin=
(neighbors_table.neighbor_id == Place.id),
secondary=neighbors_table)
and the error is:
sqlalchemy.exc.InvalidRequestError: When
What would be the recommended method of mapping something like a Money
class - objects that are a basic value + descriptor where the
descriptor (in this example currency) is more than just a primitive
variable?
For example:
class Currency(object):
def __init__(self, code, descrip):
I am trying to do an left outer join from two sql queries but cannot
find
how to join on multiple columns.
I am using the outerjoin function.
The only way I found was to use a text clause for the on clause.
Basically, I have:
q1 = create_sql1().alias('qleft')
q2 = create_sql2().alias('qright')
oj
Arno wrote:
I am trying to do an left outer join from two sql queries but cannot
find
how to join on multiple columns.
I am using the outerjoin function.
The only way I found was to use a text clause for the on clause.
Basically, I have:
q1 = create_sql1().alias('qleft')
q2 =
asrenzo wrote:
Here is a primaryjoin, secondaryjoin I tried without success:
neighbors = relation(Place, primaryjoin=(Place.id ==
neighbors_table.place_id), secondaryjoin=
(neighbors_table.neighbor_id == Place.id),
secondary=neighbors_table)
and the error is:
mgemmill wrote:
What would be the recommended method of mapping something like a Money
class - objects that are a basic value + descriptor where the
descriptor (in this example currency) is more than just a primitive
variable?
For example:
class Currency(object):
def
On 4 sep, 16:26, Michael Bayer mike...@zzzcomputing.com wrote:
Arno wrote:
I am trying to do an left outer join from two sql queries but cannot
find
how to join on multiple columns.
I am using the outerjoin function.
The only way I found was to use a text clause for the on clause.
Thanks Michael,
Everything is OK now.
Sorry for the typo, I was renaming my classes.
Regards,
Laurent
Le 04/09/2009 16:30, Michael Bayer a écrit :
asrenzo wrote:
Here is a primaryjoin, secondaryjoin I tried without success:
neighbors = relation(Place, primaryjoin=(Place.id ==
Laurent Rahuel wrote:
Thanks Michael,
Everything is OK now.
Sorry for the typo, I was renaming my classes.
it wouldn't be tough for us to enhance declarative such that you can name
Table objects in those strings as wellsince we have the MetaData
available.I'll add a ticket.
On 4 sep, 16:26, Michael Bayer mike...@zzzcomputing.com wrote:
Arno wrote:
I am trying to do an left outer join from two sql queries but cannot
find
how to join on multiple columns.
I am using the outerjoin function.
The only way I found was to use a text clause for the on clause.
Hi,
I've recently started learning sqlalchemy. So far, I am able to do everything I
needed with sqlalchemy query. Now, I am getting into a situation, and hope
someone would give me a suggestion. Below is my question.
My test table has two columns Name and Count
Name Count
A
Thanks for pointing me in the right direction Michael.
On Sep 4, 7:34 am, Michael Bayer mike...@zzzcomputing.com wrote:
mgemmill wrote:
What would be the recommended method of mapping something like a Money
class - objects that are a basic value + descriptor where the
descriptor (in this
13 matches
Mail list logo