lsbardel/python-stdnet — Issue #12: objects created in separate python processes be fetched cross process
Author: jhurt
Created: 2011-10-08 16:37:05+00:00
State: open

Hi, I have a custom django-admin command called aggregateevents that performs a map/reduce over my mongodb instance and saves the events using python-stdnet into redis. The strange thing is that when I run my app server using the django runserver command, none of the objects that were saved using the custom aggregateevents command can be found. They are there, because if I rerun the custom command it can see the previously saved objects. Here is the definition of my object:

import logging
from stdnet import orm
logger = logging.getLogger(__name__)

class RedisEvent(orm.StdModel):
lystKey = orm.SymbolField()
eventDate = orm.DateTimeField()
lystName = orm.CharField()
lystLink = orm.CharField()
profileTitle = orm.CharField()
profileLink = orm.CharField()
profilePic = orm.CharField()
text = orm.CharField()

orm.register(RedisEvent,'redis://127.0.0.1/?db=0', keyprefix='lystee', timeout=3600)
logger.debug('total aggregated: ' + str(RedisEvent.objects.all().count()))

Shouldn't all python processes be able to fetch saved instances of objects stored in Redis, as long as the connection string, db number, and key prefix match?