I'm using SQLAlchemy 0.4.6 with Python 2.5.2, and having a problem
with deleting object. Below is the testing code that shows my problem:
from sqlalchemy import *
from sqlalchemy.orm import *
engine = create_engine('sqlite:///C:/test_db.sqlite')
Session = sessionmaker(bind=engine,
On Jun 30, 2008, at 1:27 AM, Andreas Jung wrote:
--On 29. Juni 2008 16:57:16 -0400 Michael Bayer [EMAIL PROTECTED]
wrote:
On Jun 29, 2008, at 12:46 PM, Andreas Jung wrote:
This approach is ugly (because of putting the mapper within the
local
scope into the global scope (in order
On Jun 30, 2008, at 4:37 AM, Tai Tran wrote:
# Create a new Foo object, then save it to the database
db_session = Session()
f = Foo('001')
db_session.save(f)
db_session.commit()
# Try deleting Foo object created above with a new, different
session
db_session2 =
Hi,
Based on some posts I was able to find scouring Google, I was trying
to implement a custom type (GeometryType) for the PostGIS GEOMETRY
column.
Now, I should point out that I am not using sqlalchemy to build the
DDL, since the geometry columns are indirectly created by invoking
stored
I must be missing something simple, but with SQLA 0.4.6 I can't get
the logging to work without using the echo flag. When I do set echo =
True and leave my logging configuration code I get the double logging
problem mentioned in the docs.
My apologies if this is just a logging module issue.
On Jun 30, 2008, at 1:04 PM, Hans wrote:
The problem is that I'd like to have sqlalchemy return KML for all
geometry types by default, but I don't know how to setup my type to
specify a SQL function that needs to be applied to the column in the
select clause. Is this possible?
On Jun 30, 1:24 pm, Michael Bayer [EMAIL PROTECTED] wrote:
On Jun 30, 2008, at 1:04 PM, Hans wrote:
The problem is that I'd like to have sqlalchemy return KML for all
geometry types by default, but I don't know how to setup my type to
specify a SQL function that needs to be applied to
Hi guys, I'm new to this list but I I'm using SA from a while ago. I'm
wondering how to sort a query based on a child table attribute.
Table A- Many to One - Table B.
I need to make a query in A, then order those records by a property of B.
query = session.query(A).order_by( B.something )
Folks-
I'm (seemingly) randomly running across this issue in my pylons/SA
app.
I'm generating a SQL where clause like so:
where = sa.and_(cal_table.c.adweekid == table.c.adweekid, )
and every so often I'll get an attribute error in sqlalchemy.util:494
in __getattr__
type
On Jun 30, 2008, at 4:41 PM, matt harrison wrote:
Folks-
I'm (seemingly) randomly running across this issue in my pylons/SA
app.
I'm generating a SQL where clause like so:
where = sa.and_(cal_table.c.adweekid == table.c.adweekid, )
and every so often I'll get an attribute error
On Jun 30, 2:46 pm, Michael Bayer [EMAIL PROTECTED] wrote:
On Jun 30, 2008, at 4:41 PM, matt harrison wrote:
Folks-
I'm (seemingly) randomly running across this issue in my pylons/SA
app.
I'm generating a SQL where clause like so:
where = sa.and_(cal_table.c.adweekid ==
I thought this was a scope problem, but it seems to be even bigger.
This is the error I get:
OperationalError: (OperationalError) (1067, Invalid default value for
'date_created') u'\nCREATE TABLE fu_op_requests (\n
\tfu_op_requests_id INTEGER NOT NULL AUTO_INCREMENT, \n\tname
VARCHAR(50),
running this script:
import sqlalchemy
from sqlalchemy.databases import mysql
engine = sqlalchemy.create_engine('mysql://scott:[EMAIL PROTECTED]/
test', echo=True)
metadata = sqlalchemy.MetaData(engine)
purchases_table = sqlalchemy.Table('fu_op_purchases',metadata,
I found the solution using Joins. Thanks anyways.
This is it:
query = session.query(A).select_from(join(A, B)).order_by(B.some_attr)
cheers
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post
14 matches
Mail list logo