小编Med*_*vin的帖子

Django-filter,如何进行多字段搜索?(使用 django 过滤器!)

如何使用 Django-filter 从模型中进行多个字段搜索,例如:

class Location(models.Model):
    loc = models.CharField(max_length=100, blank=True)
    loc_mansioned = models.CharField(max_length=100, blank=True)
    loc_country = models.CharField(max_length=100, blank=True)
    loc_modern = models.CharField(max_length=100, blank=True)
Run Code Online (Sandbox Code Playgroud)

我的网站上需要一个输入字段,可以搜索位置模型的所有字段

python django django-filter

11
推荐指数
1
解决办法
9946
查看次数

标签 统计

django ×1

django-filter ×1

python ×1