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
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
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
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,