Hi Nil,
On 14/09/2010 21:58, NiL wrote:
Hi Werner,
many thanks for your rich reply.
I'm going to try an elixir implementation for now. If you want follow
the thread of the same title in the elixir mailing list.
Thanks for letting me know.
One of the things which disturb me about SA or
The following test fails in 0.6.4 but not 0.6.3 with AttributeError:
type object 'Person' has no attribute 'foo'. Is this a deliberate
change? It seems a bit weird that every @classproperty on a
declarative subclass is accessed/run on import.
from sqlalchemy import create_engine, Column, String
On Sep 15, 2010, at 10:04 AM, Nikolaj wrote:
The following test fails in 0.6.4 but not 0.6.3 with AttributeError:
type object 'Person' has no attribute 'foo'. Is this a deliberate
change? It seems a bit weird that every @classproperty on a
declarative subclass is accessed/run on import.
On 15/09/2010 15:04, Nikolaj wrote:
Base = declarative_base()
class Person(Base):
__tablename__ = 'people'
name = Column(String, primary_key=True)
@classproperty
def bar(cls):
return cls.foo
Can you explain why you'd want to do something like this?
Chris
--
On Sep 15, 2010, at 12:10 PM, Chris Withers wrote:
On 15/09/2010 15:04, Nikolaj wrote:
Base = declarative_base()
class Person(Base):
__tablename__ = 'people'
name = Column(String, primary_key=True)
@classproperty
def bar(cls):
return cls.foo
Can you
I've got database with auto increment column called `id` and INSERT
query, whom I need to execute without model declaration in project.
meta.Session.execute() returns ResultProxy, but last_inserted_ids()
doesn't work with execute() and SELECT LAST_INSERT_ID() statement
sometimes return 0. Is there
SELECT LAST_INSERT_ID() is ultimately where the value comes from - the raw
.lastrowid is present on the ResultProxy for those DBAPIs which support it, so
try using that. Perhaps you're getting 0 because the transaction is going
away, in which case .lastrowid should solve that issue.
On Sep
You mean something like this:
import sqlalchemy.types as types
class CHAR(types.TypeDecorator):
'''Strips padding from CHAR types.
'''
impl = types.CHAR
def process_bind_param(self, value, dialect):
return value
def process_result_value(self, value, dialect):
This is driving me crazy since I can't even get through the tutorial :
( Thanks for any help! code, then error below.
#! /usr/local/bin/python
dbtestpy
Walking through sqlalchemy tutorial
Author: Michelle Brenner
from sqlalchemy import Table, Column, Integer, Float,
On Sep 9, 9:53 am, Conor conor.edward.da...@gmail.com wrote:
On 09/08/2010 01:05 PM, Jack Kordas wrote:
When I try to use both aliases and labels, the results are not named
as expected.
Instead of being able to access the columns as label-name_column-
name it appears as
Try moving the metadata.create_all(engine) below the User class declaration.
Like:
snipped code
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
name = Column(String)
fullname = Column(String)
password = Column(String)
def __init__(self, name,
Lastrowid return: Could not locate column in row for column
'lastrowid'. I try to use transaction:
trans = meta.Session.begin()
try:
meta.Session.execute(INSERT statement)
result = meta.Session.execute(SELECT LAST_INSERT_ID())
trans.commit()
except:
trans.rollback()
raise
Hi,
I'm using SqlAlchemy 0.6.3 and PostgreSQL 8.4 and I'm trying to setup
a cascading delete between several levels of tables. The problem seems
to be that I can't have a relationship with cascade=all and a column
with ForeignKey that has nullable=False.
Here is my example:
from sqlalchemy
On 09/15/2010 05:04 PM, BenH wrote:
Hi,
I'm using SqlAlchemy 0.6.3 and PostgreSQL 8.4 and I'm trying to setup
a cascading delete between several levels of tables. The problem seems
to be that I can't have a relationship with cascade=all and a column
with ForeignKey that has nullable=False.
no its not a column on a row, its on the ResultProxy:
result = session.execute('...')
id = result.lastrowid
http://www.sqlalchemy.org/docs/core/connections.html?highlight=resultproxy#sqlalchemy.engine.base.ResultProxy.lastrowid
On Sep 15, 2010, at 5:51 PM, phasma wrote:
Lastrowid return:
15 matches
Mail list logo