And a second version with SUBSTR

def operator_field_starts(field, first_int, query_env={}):
    '''bla bla '''
    if not field.type != 'list:integer':
        raise AttributeError, "bla bla"
    dialect = field._dialect
    second = '|'+dialect._like_escaper_default(str(first_int))+'|'
    return "(%s = '%s')"%(
        dialect.substring(field, (1,len(second))),
        second
    )



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/77b0d95e-d7e8-4df6-94b3-7bcc52ad5fa5%40googlegroups.com.

Reply via email to