Take a look at using ordering_list for the collection class on your
relation. You add a position in season and SQLAlchemy will maintain the
value.
http://www.sqlalchemy.org/docs/orm/extensions/orderinglist.html
--
Mike Conley
--
You received this message because you are subscribed to the
The following code is DB specific:
import sqlalchemy
# ...
ergebnis = session.query(
my_object.attr1).filter(sa.and_(
my_object.attr2 != 'NaN')).all() # PostgreSQL
# my_object.attr2 != None)).all() # sQLite
With PostgreSQL it is 'NaN', with SQLite None
Hi everyone, I'm writing a script using sqlalchemy 0.66 and sqlite3.
I'm encountering a problem trying to create and load a table from two
different engines.
Here is an example script showing the problem:
from sqlalchemy import *
engine1 = create_engine(sqlite:///test.db, echo=False)
metadata1 =
On Apr 7, 2011, at 12:46 AM, Randy Syring wrote:
I am running Ubuntu 10.04, python 2.6.5, SA 0.6.6, latest pyodbc
release. I have tried FreeTDS that ships with the distro (0.82) as
well as current CVS. I can make a connection and issue a basic SQL
statement. However, when I try to run my
On Apr 7, 2011, at 9:35 AM, Massi wrote:
Hi everyone, I'm writing a script using sqlalchemy 0.66 and sqlite3.
I'm encountering a problem trying to create and load a table from two
different engines.
Here is an example script showing the problem:
from sqlalchemy import *
engine1 =
On Apr 7, 2011, at 1:25 AM, Philipp Rautenberg wrote:
The following code is DB specific:
import sqlalchemy
# ...
ergebnis = session.query(
my_object.attr1).filter(sa.and_(
my_object.attr2 != 'NaN')).all() # PostgreSQL
# my_object.attr2 !=
Hi. With SQLA 0.6.6, the program below fails on the last line with
ObjectDeletedError. Is this expected or a bug?
from sqlalchemy import create_engine, MetaData, Column, Unicode
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
engine =
Hi, in part of my model I have a TaskIntro item and RedirectRule item
connected with relation one-to-one one-sided, mapper for TaskIntro
looks like:
mapper(
TaskIntro,
table,
version_id_col = table.c.version ,
properties={
...
it is a bug and ticket 2122 has the fix for this. However I'd like to target
this at 0.7 since it rearranges things in update()/delete() significantly and
I'd like to add test coverage for all the changes that have been made. The
workaround for 0.6 is to pass False or fetch to the delete()
On Apr 7, 2011, at 11:07 AM, Aleksander Siewierski wrote:
Hi, in part of my model I have a TaskIntro item and RedirectRule item
connected with relation one-to-one one-sided, mapper for TaskIntro
looks like:
mapper(
TaskIntro,
table,
version_id_col =
OK, thanks, this was part of the ActiveRecord kind of approach I was
playing with, which after reading your article at zzzeek and the
alternative described there I will probably shelve.
On Apr 6, 9:59 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Apr 6, 2011, at 6:38 AM, farcat wrote:
Hi Michael,
I am trying to run the alternative you described in the article, but
the following code is most likely from an old version of SA a don't
know how to update (I am working with 6.6):
mapper = class_mapper(cls)
table = mapper.local_table
Hello,
I am pretty determined to find a way to get (a simplified version of)
multiple inheritance working with SA. The simplification lies in that
no overriding of attributes will be possible (but I don't know whether
that is significant). I was thinking of a schema as follows:
On Apr 7, 2011, at 2:30 PM, Lars wrote:
Hello,
I am pretty determined to find a way to get (a simplified version of)
multiple inheritance working with SA. The simplification lies in that
no overriding of attributes will be possible (but I don't know whether
that is significant). I was
Seems to be a unicode conversion problem, if you are interested in
following, the pyodbc issue with very small test case is here:
http://code.google.com/p/pyodbc/issues/detail?id=170
On Apr 7, 9:37 am, Michael Bayer mike...@zzzcomputing.com wrote:
On Apr 7, 2011, at 12:46 AM, Randy Syring
Hello there. I'm using SA-0.7 to develop an application that should
help me manage my company's services.
A central concept here is the order, it could be a service (like one
year of web hosting) or a physical item (like a pc we sell). So far I
generalized them in two classes: the Order and the
Hi,
I have an objects that when I convert to a string using __repr__
throws a DetachedInstanceError. If I access any of their members or
test the session (using 'user in Session') everything is fine but if I
check 'self in Session' in __repr__ the result is False.
I can reattach it to the Session
On Apr 7, 2011, at 9:54 PM, BenH wrote:
Hi,
I have an objects that when I convert to a string using __repr__
throws a DetachedInstanceError. If I access any of their members or
test the session (using 'user in Session') everything is fine but if I
check 'self in Session' in __repr__ the
18 matches
Mail list logo