Python client and allow_mult

Eric Moritz eric at themoritzfamily.com
Fri Apr 1 13:08:46 EDT 2011


Does anyone have a standard pattern for working with allow_mult with
the Python library?  I feels a bit awkward to me.  I assume I need to
do the following:

data = {"foo": "bar"}
obj = bucket.get("mykey")

if not obj.exists():
      obj = bucket.new("mykey", data=data)
else:
   if obj.has_siblings():
       # do conflict resolution
   else:
       obj.set_data(data)

obj.store()

Is the the way to do it?  If so, that seems like a lot of boiler plating to me.

Eric.




More information about the riak-users mailing list