I hope this list may be interested in this package based on
sqlalchemy.
Working with sqlalchemy has been a very nice experience, any day
discovering
some nice feature of sqlalchemy that just fitted my needs.
I know I only used a subset of SA power but my intention is to add
features as
long as I
sure its along these lines
class Content(my_declarative_base):
__tablename__ = 'content'
id = Column(Integer, primary_key=True)
title = Column(String(80))
parent_id = Column(Integer, ForeignKey('content.id'))
type = Column(String(32))
children =
I have a table that defines a self-referential hierarchy. My problem
is figuring out how to specify that relationship in declarative
syntax. From reading the documentation and looking at example
basic_tree.py, I think I understand it when using tables and mappers,
but can't get it right with
always use remote_side=table.c.id on the many to one side of a self
referential relation, in the case of declarative it would look like
remote_side=id. See
http://www.sqlalchemy.org/docs/05/mappers.html#advdatamapping_relation_selfreferential
for information on this.
On Nov 11, 2008,
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of John Hunter
Sent: 11 November 2008 01:54
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Re: select where field=max(field)
On Mon, Nov 10, 2008 at 11:10 AM, Michael Bayer
[EMAIL
someone ran into a variant of it earlier, and we've had other variants
in the past.
On Nov 10, 2008, at 10:36 PM, arashf wrote:
gotcha, cool. was I first to run into this? :-)
On Nov 10, 5:57 pm, Michael Bayer [EMAIL PROTECTED] wrote:
yeah this is an enhancement we made, whereby
Thanks for the pointer about remote_side.
In my application, the table definitions are not visible at runtime,
and the class definitions are autoloaded from the engine. So, I can't
say remote_side=table.c.id because table is not available. I do have
this solution that works well:
class
On Nov 11, 2008, at 4:52 PM, MikeCo wrote:
Thanks for the pointer about remote_side.
In my application, the table definitions are not visible at runtime,
and the class definitions are autoloaded from the engine. So, I can't
say remote_side=table.c.id because table is not available. I do
Michael Bayer wrote:
On Nov 10, 2008, at 12:10 PM, Werner F. Bruhin wrote:
Michael,
Michael Bayer wrote:
I know what this is and it should be working in r5280. I don't have
access to firebird here so we weren't able to run the tests on it
before rc3 was out.
Installed
What is the best way to store content in multiple languages
(translations) ?
The same question about the prices in multiple currencies ?
The problem:
World Wide Book Shop (collection of books from multiple countries in
multiple currencies and languages)
Model:
##
Book
Does somebody know if is possible to use a declarative class
definition for the schema below
content = Table('content', meta.metadata,
Column('id', types.Integer, primary_key=True, autoincrement=True),
Column('title', types.String(80)),
Column('parent_id', types.Integer,
On Tue, Nov 11, 2008 at 4:31 AM, King Simon-NFHD78
[EMAIL PROTECTED] wrote:
Which is pretty much the query we wanted, apart from the names. I hope
it works in your original example as well!
This worked great -- and I learned a bunch of useful sql and
sqlalchemy tricks along the way. Many
I want to build a relation to a class located in a different file
file user.py
---
class Users(Base):
__tablename__ = 'users'
username = Column(types.String(32), primary_key=True)
password = Column(types.String(32))
file content.py
---
from user import
Michael Bayer wrote:
You're on the right track. The reflection methods are always called
with a Connection that is not shared among any other thread
(connections aren't considered to be threadsafe in any case) so
threadsafety is not a concern.
I think you should look at the mysql
14 matches
Mail list logo