[sqlalchemy] Re: Using sqlalchemy in twisted.

2009-03-15 Thread Pedro Algarvio, aka, s0undt3ch
On Mar 11, 2:13 pm, 一首诗 wrote: > Hi Jeff, > > In my project I use the *model* to indicate an instance of Database. > I don't really need multiple instances of Database. But when I wrote > unit test, I always create an new one database in setup, which create > a new sqlite in memory database to

[sqlalchemy] datetime objects unique by date(disregarding time)

2007-09-06 Thread Pedro Algarvio, aka, s0undt3ch
How could one get only the unique dates from a datetime column, disregarding the time part of the datetime object? I know I can do: >>> s = model.sqla.select([model.channel_events.c.stamp], >>> model.channel_events.c.channel_participation_id == 5) >>> results = model.Session.execute(s).fetchall

[sqlalchemy] Re: How do I 'relation' this?

2007-08-26 Thread Pedro Algarvio, aka, s0undt3ch
stepz on #sqlalchemy helped me to get my mind together and followed me through setting up all shown bellow: ---8<---8<---8<---8<---8<---8<---8<---8<---8<--- from pylons import config #from oil.lib.helpers import url_for #from sqlalchemy import Column, MetaDa

[sqlalchemy] How do I 'relation' this?

2007-08-26 Thread Pedro Algarvio, aka, s0undt3ch
Firstly, I'll explain my database layout: I have a User table, which it's layout is not that important to the problem at hands; A Bots Table: bots = sqla.Table('bots', metadata, sqla.Column('id', sqla.Integer, primary_key=True, autoincrement=True), sqla.Column('nick', sqla.Unicode,