tortoise/tortoise-orm

Feature request: filter like and ilike

Aperta

#421 aperta il 29 mag 2020

 (9 commenti) (0 reazioni) (1 assegnatario)Python (333 fork)batch import
enhancementgood first issue

Metriche repository

Star
 (3863 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Example of usage:

users = await User.filter(first_name__ilike="c%r")

I know this can be done with startswith and endswith, but there are cases where using the LIKE operator is better:

users = await User.filter(first_name__ilike="j_r%")

This would be used to match Jeremy, Jorge, Jordan...

Guida contributor