Hi!
I'm trying to filter my data by some date calculations.
In detail, I want to filter out messages that have been marked as
deleted more than 30 days ago.
In a query I could do it like this:
threshold = datetime.now() - datetime.timedelta(30)
return
oh, heres a second version that fixes list.__setitem__.
the operations here are not terribly efficient but you could build
better caching scenarios if needed.
from sqlalchemy import *
from sqlalchemy.orm import *
metadata = MetaData()
objects = Table('objects', metadata,
Column('id',
yet another adjustment to ListAdapter...
class ListAdapter(object):
def __init__(self, parent, key):
self.__parent = parent
self.__key = key
def __cached(self):
try:
return self.__cached_data
except AttributeError:
also, it would take a lot more experimentation but maybe the @appender
and @remover methods could be useful here, just so that the cached
view of the data can be maintained as the data is retrieved from the
DB.Maybe its just my thought process (also since i didnt write the
collections
It occurs to me that a near analogue to this would be... storing a
collection of one man's children by different mothers. While it's
somewhat useful to have a collection of the guy's children... what if
you want to look up his children by just one mother, or by each mother
in turn. There's an
I have to be able to dump my tables to CSV so I need to keep the primary
key values so my foreign keys match up.
Michael Bayer wrote:
On Feb 15, 2008, at 5:53 PM, Brett wrote:
serial column instead. On sqlite the id column seems to always
generate
a unique number. I'm not sure what
On Feb 16, 2008, at 8:31 PM, Brett wrote:
I have to be able to dump my tables to CSV so I need to keep the
primary
key values so my foreign keys match up.
Michael Bayer wrote:
On Feb 15, 2008, at 5:53 PM, Brett wrote:
serial column instead. On sqlite the id column seems to always