Open GoogleCodeExporter opened 9 years ago
For example:
>>> class Test(Document):
>>> data = ListField(TextField())
>>> doc = Test()
>>> doc.data = ['1', '2', '3']
First test:
>>> assert isinstance(doc.data, list), 'ooops (:'
if previously you could used some function which expects only list type, so now
you must explicitly convert ListField to list object, but before that you'll
spent some time with debug mode on.
>>> heapq.heappush(doc.data, '7') # failed, list expected
also you apply this patch you will make no more such trick:
>>> doc.data += ['4', '5', '6']
>>> doc.data *= 2
and many others. However, this patch shows a lot of flaws of current ListField
implementation - all my cons are working, except first one, but without any
excepted result. It must have be for sure.
Original comment by kxepal
on 14 Mar 2011 at 9:17
I thought about `isinstance` case and some list operations but decided that it
would be the lesser of evils.
Original comment by daevaorn
on 14 Mar 2011 at 9:48
This issue has been migrated to GitHub. Please continue discussion here:
https://github.com/djc/couchdb-python/issues/172
Original comment by djc.ochtman
on 15 Jul 2014 at 7:21
Original issue reported on code.google.com by
daevaorn
on 13 Mar 2011 at 8:57Attachments: