Just want to quickly clarify how to store timestamps in Riak Search
using Python. My code:

                dt = datetime.datetime.strptime(data['Time(PDT)'], "%b %d, %Y 
%H:%M:%S")
                ut = time.mktime(dt.timetuple())
                data['Time(PDT)'] = int(ut)
                        
                # Save the object to Riak.
                json = simplejson.dumps(data)
                obj = bucket.new(data['Time(PDT)'], data=json)
                obj.store(return_body=False)

This is giving me:

TypeError: 1275598830 has type <type 'int'>, but expected one of:
(<type 'str'>,)

Am I misunderstanding something fundamental here?

Thanks
Mike

_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to