2017-10-25 django django models objects filter by dict kwargs 1. 大于等于、小于等于 12345Model.objects.filter(price__gte=10, price__lte=15)# orkwargs = {'price__gte': 10, 'price__lte': 15} Model.objects.filter(**kwargs) 2. LIKE、包含 12kwargs = {filter_field + '__icontains': filter_content}edu_mtrl_list = edu_mtrl_list.filter(**kwargs) https://stackoverflow.com/questions/1763495/adding-extra-parameters-to-a-objects-filter-via-dict Newer django multi database Older django models not equal exclude filter