I have a list of names:
names = ['pupkin vasyl', 'pupkin2 vasyl2', 'pupkin3 vasyl3']
and want to get all records for this names by IN statement (yeh its bad practice):User.objects.filter(name__in=names).all()
builded sql is like this:SELECT user.name, ... FROM user WHERE `user`.`name` IN (pupkin vasyl, pupkin2 vasyl2, pupkin3 vasyl3)
problem is that django don`t put list values in quotes
No comments:
Post a Comment