I have this and it works perfect
Model.name.startswith(name)
but i need this
name.startswith(Model.name)
Occurrence of a field value in a string. Thx
I have this and it works perfect
Model.name.startswith(name)
but i need this
name.startswith(Model.name)
Occurrence of a field value in a string. Thx
Use Value(). Note that a wildcard is added
Model.select().where(Value(name).startswith(Model.name))
The corresponding SQL, approximately:
SELECT id, name
FROM model_tbl
WHERE '<value in name var>' LIKE (name || '%')