Closed jeloou closed 12 years ago
This allows to add multiple values to containers in a easier way.
Sets:
from redisco.containers import Set s = Set('s') s.add('bananas', 'tomatoes') s.add(['blackberries', 'strawberries']) print s.members # -> set(['blackberries', 'strawberries', 'tomatoes', 'bananas']) s.remove('bananas', 'blackberries') # -> True print s.members # -> set(['strawberries', 'tomatoes'])
Lists:
from redisco.containers import List l = List('l') l.append('a') l.append(['b', 'c']) l.append('d', 'e', 'f') print l # -> ['a', 'b', 'c', 'd', 'e', 'f']
Sorted set:
from redisco.containers import SortedSet z = SortedSet('z') z.add('a', 1) z.add({'f' : 200, 'e' : 201}) print z.members # -> ['a', 'f', 'e']
This pull request passes (merged ee73e307 into 46c165f3).
This reminds me that the doc really need some love now.
This allows to add multiple values to containers in a easier way.
Sets:
Lists:
Sorted set: