【发布时间】:2020-08-11 11:51:39
【问题描述】:
如何将短语手册变成 *参数
我的意思是,具体来说,django 中的示例
我们有:
.order_by('field1', 'field2'...)
我愿意做
if sort =="byName":
a=[] #????
a.append('name')
a.append('surname')
.order_by(a) #???
【问题讨论】:
-
是吗?只需使用
order_by(*a)?
标签: django python-3.x function arguments