Hi,
Your TaskExtension class doesn't have a translate_row method, which
apparently is part of the MapperExtension interface (although it doesn't
appear in the docs). From the source code (in orm/mapper.py):
def translate_row(self, mapper, context, row):
Perform pre-processing on the
Pirkka wrote:
I started migrating from ActiveMapper to Elixir, and have been
wrestling with this for hours:
DBAPIError: (Connection failed) (OperationalError) (2005, Unknown
MySQL server host '/Applications/MAMP/tmp/mysql/mysql.sock' (1))
Here are the command parameters that sqlalchemy
Max Ischenko wrote:
On May 10, 4:38 pm, King Simon-NFHD78 [EMAIL PROTECTED]
wrote:
You're halfway there with your 'posts' relation. I think if you pass
backref='author' in your relation, then WordpressPost
objects will get
an 'author' property which points back to the WordpressUser
I think the answer to this partly depends on which parts of SA you are
using, and how your databases are set up. If all the databases have
different schemas, and you are using the low-level SA API (or your ORM
objects are each defined against a single database), I would probably
use a
Hi,
I just noticed that autoloading of tables on old versions of MySQL is
broken (I'm using 3.23.58, but I believe the problem will occur up to
4.1.1)
The problem is that reflecttable tries to use the
'character_set_results' system variable, which was only introduced in
4.1.1. The attached patch
The way to hook most parts of the ORM is by creating a MapperExtension
http://www.sqlalchemy.org/docs/adv_datamapping.html#advdatamapping_exte
nding. Basically, define a subclass of MapperExtension, overriding
whichever method you are interested in (possibly append_result or
create_instance in
SQLAlchemy Column objects override the '==' operator (and many others as
well) so that python expressions get converted to appropriate SQL
expressions.
It's mentioned (briefly) here:
http://www.sqlalchemy.org/docs/sqlconstruction.html#sql_whereclause
Hope that helps,
Simon
-Original
What do you mean by a model? If you are talking about an instance of a
mapped class, you could try something like this (untested):
def model_to_dict(instance):
model_dict = {}
for propname in instance.mapper.props:
model_dict[propname] = getattr(instance, propname)
return
You want something like this:
user_table = Table('users', metadata, Column('userid', String(8)))
user_table.create(checkfirst=True)
# or
# metadata.create_all(checkfirst=True)
Documentation is at:
http://www.sqlalchemy.org/docs/metadata.html#metadata_creating
Hope that helps,
Simon
databases/mysql.py has this snippet in create_connect_args (0.3.10):
# FOUND_ROWS must be set in CLIENT_FLAGS for to enable
# supports_sane_rowcount.
client_flag = opts.get('client_flag', 0)
if self.dbapi is not None:
try:
import
Hi,
I think this is a pretty good match for Joined Table polymorphic
inheritance, as described in the docs
http://www.sqlalchemy.org/docs/adv_datamapping.html#advdatamapping_inhe
ritance_joined. Your nodes_table would correspond to the employees
table, and the 'subclass' tables such as video
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of mc
Sent: 15 August 2007 14:23
To: sqlalchemy
Subject: [sqlalchemy] Outerjoin with a subset of columns
Hi,
Note the following code:
oj=outerjoin(s,f)
Noufal wrote:
snip
I create two tables like so
run_table = sa.Table('runs',md,
sa.Column('rid', sa.Integer,
primary_key=True),
sa.Column('cmdline', sa.String(250)),
sa.Column('hostname',
Hi,
The ancient version of MySQL that I am connecting to (3.23.58) doesn't
support the syntax 'LIMIT limit OFFSET offset' syntax. Instead, it
uses LIMIT offset, limit. This is described in the docs, but it
doesn't say what version introduced the more standard syntax:
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Ken Pierce
Sent: 29 September 2007 00:21
To: sqlalchemy
Subject: [sqlalchemy] one-to-many access and modification
Hello all,
I just got into using sqlalchemy today and I have a
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of klaus
Sent: 22 October 2007 11:33
To: sqlalchemy
Subject: [sqlalchemy] Please add some __len__ methods
Hi all,
I wonder why some classes/objects implement part of a list interface -
You may be interested in an older thread, 'How to get list of
relations':
http://groups.google.com/group/sqlalchemy/browse_thread/thread/ff03af921
eb12acb/861597e8a72f5e6f
Simon
-Original Message-
From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Christophe
201 - 217 of 217 matches
Mail list logo