Using web2py 1.87.2 with sqlite

I need to store and retrieve a list of strings from a multple select.
I have a case where the list can be the empty list []. It will encode
to the datebase as '||', but will decode to ['|'], not [].

The current gluon.sql.py is:

def bar_encode(items):
    return '|%s|' % '|'.join(bar_escape(item) for item in items if
str(item).strip())

def bar_decode_string(value):
    return [x.replace('||','|') for x in string_unpack.split(value) if
x.strip()]

I believe the following would fix this:

def bar_decode_string(value):
    return [x.replace('||','|') for x in
string_unpack.split(value[1:-1]) if x.strip()]

Reply via email to