If your schema is dynamic, in most languages there isn't much you can do, but at least in python
Q(name=contains('k'))
it is not particularly more complex to write and certainly more composable, extensible and checkable.Alternatively go full eval and do
Q("'k' in name")