def getModelResult(model,*orders,**wheres): ret=model.objects ret=ret.filter(**wheres) for order in orders: ret=ret.order_by(order) return ret
ret=getModleResult(Article,’-createtime’,uid=1,username=’aaa’)
总结:
wheres = {"name": "test", "age":18}
models.User.objects.filer(***wheres)