How do I do mysql "LIKE" in django?
SELECT * from m开发者_开发百科yapp_mymodel WHERE code LIKE "914%";
I would recommend reading the manual, it clearly tells you how to do this: http://docs.djangoproject.com/en/dev/ref/models/querysets/#startswith
MyModel.objects.filter(code__startswith='914')
精彩评论