开发者

Django: function get_model with a tuple

The django function get_model() takes an app name and model, but I was curious as to whether you can us it with a tuple

i.e. something like

get_model(('app','model'))

Thanks, sorry if this is basi开发者_如何转开发c


Why not? it's python! Expand your tuple with *

get_model(*('app', 'model'))

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜