我正在尝试设置基本提要:
from stream_framework.feeds.redis import RedisFeed
class PinFeed(RedisFeed):
key_format = 'feed:normal:%(user_id)s'
class UserPinFeed(PinFeed):
key_format = 'feed:user:%(user_id)s'
feed = UserPinFeed(13)
但是当我feed[:2]
在添加一个活动后运行时,我不断收到这个错误:
<ipython-input-25-41b7cd0d0d8c> in <module>()
----> 1 feed[:2]
/Users/home/venv/lib/python2.7/site-packages/stream_framework/feeds/base.pyc in __getitem__(self, k)
303 try:
304 results = self.get_activity_slice(
--> 305 start, bound)
306 except StopIteration:
307 # There's nothing left, even though the bound is higher.
/Users/home/venv/lib/python2.7/site-packages/stream_framework/feeds/base.pyc in get_activity_slice(self, start, stop, rehydrate)
354 print 'line 350'
355 if self.needs_hydration(activities) and rehydrate:
--> 356 activities = self.hydrate_activities(activities)
357 return activities
358
/Users/home/venv/lib/python2.7/site-packages/stream_framework/feeds/base.pyc in hydrate_activities(self, activities)
332 activity_data = {a.serialization_id: a for a in activity_list}
333 print activity_data
--> 334 return [activity.get_hydrated(activity_data) for activity in activities]
335
336 def needs_hydration(self, activities):
/Users/home/venv/lib/python2.7/site-packages/stream_framework/activity.pyc in get_hydrated(self, activities)
42
43 '''
---> 44 activity = activities[int(self.serialization_id)]
45 activity.dehydrated = False
46 return activity
KeyError: 14929294667170000000001005L
我可以打印出来[<stream_framework.activity.DehydratedActivity object at 0x10e114e90>]
并且[u'14929294667170000000001005']
.
任何线索可能导致这种情况?