开发者

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')
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜