Django-filter报错:__init__() got an unexpected keyword argument 'name'
原因是 自从 django-filter2.0之后 将Filter的name字段 更名为 field_name 所以需要这样写:
class GoodsFilter(filters.FilterSet):
pricemin = filters.NumberFilter(field_name="shop_price", lookup_expr='gte')
pricemax = filters.NumberFilter(field_name="shop_price", lookup_expr='lte')
class Meta:
model = Goods
fields = ['pricemin', 'pricemax']
Django-filter报错:__init__() got an unexpected keyword argument 'name'的更多相关文章
- Celery 启动报错 can_read() got an unexpected keyword argument timeout
问题: Celery 启动报错 can_read() got an unexpected keyword argument timeout 方案:更改redis版本和celery版本,我使用下面的ce ...
- 关于Jupyter Notebook无法自动补全(Autocompletion),报错TypeError: __init__() got an unexpected keyword argument 'column' 的解决方案
关于Jupyter Notebook无法自动补全(Autocompletion),报错TypeError: __init__() got an unexpected keyword argument ...
- Django2.0——django-filter: TypeError at *** __init__() got an unexpected keyword argument 'name'
在使用 Django2.0 版本的 Django Rest Framwork 时,Django DeBug 报错 django-filter: TypeError at *** __init__() ...
- TypeError: __init__() got an unexpected keyword argument 't_command'
python .\manage.py migrate 报错如下 λ python .\manage.py migrateTraceback (most recent call last): File ...
- senlin __init__() got an unexpected keyword argument 'additional_headers'
从senlin源码重新编译更新了服务,然后执行 senlin的 cli就遇到了错误: __init__() got an unexpected keyword argument 'additional ...
- TypeError: __init__() got an unexpected keyword argument 'serialized_options'
问题描述: TypeError: __init__() got an unexpected keyword argument 'serialized_options' File "objec ...
- django出现__init__() got an unexpected keyword argument 'mimetype‘ 问题解决
这种问题好多新手按照djangobook学习的时候应该都遇到过,是因为这是老的django的写法,新的django已经升级改变了很多东西. 处理方法如下: I think you are not us ...
- kivy __init__() got an unexpected keyword argument '__no_builder' Kivy
from kivy.lang.builder import Builder from kivy.app import App, runTouchApp from kivy.uix.boxlayout ...
- ypeError: __init__() got an unexpected keyword argument 'shape'
采用TensorFlow支持通过tf.Graph函数来生成新的向量图,代码如下: import tensorflow as tf g1 = tf.Graph() with g1.as_default( ...
随机推荐
- ueditor粘贴word图片无法显示的问题
图片的复制无非有两种方法,一种是图片直接上传到服务器,另外一种转换成二进制流的base64码目前限chrome浏览器使用首先以um-editor的二进制流保存为例:打开umeditor.js,找到UM ...
- codeforces1213F tarjan缩点+拓扑排序
题意 给定两个长度为n的排列p和q,构造一个字符串s满足\(s[p_i]<=s[p_{i+1}]\)和\(s[q_i]<=s[q_{i+1}]\),且满足字符串中不同字符的个数不少于k. ...
- P1582 倒水,P2158 [SDOI2008]仪仗队——数学,二进制
有n个瓶子,里面都有一升水,但是只想保留k个瓶子,只能两个瓶子里面的水体积相等时才能倒在一个瓶子里:不能丢弃有水的瓶子:瓶子容量无限: 问需要购买几个额外的瓶子才能满足条件: 因为每个瓶子一开始只有一 ...
- c 判断字符是否为字母 (iswalpha example)
#include <stdio.h> #include <wctype.h> int main () { ; wchar_t str[] = L"C++"; ...
- hdu6736(寻找最小环)
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=6736 题意: 在给定图中寻找所有最小环 保证不存在一条边经过两个简单环 数据范围: $1\leq n ...
- RuntimeException异常处理汇总
Java中所有异常的父类是Throwable类,在Throwable类下有两大子类: 一个是Error类,指系统错误异常,例如:VirtualMachineError 虚拟机错误,ThreadDeat ...
- Oracle JDBC 标准连接实例
Oracle JDBC 标准连接实例 // 创建一个数据库连接 Connection con = null; // 创建预编译语句对象,一般用PreparedStatement不用Statement ...
- ph:做参考
1 波动学 <伯克利物理学教程>第三卷 上.下册2 场论(朗道)3 场论与粒子物理学(上册)(李政道)出国留学必备书之一!4 场论与粒子物理学(下册)(李政道)5 非平衡态热力 ...
- Git 基本应用
微信公众号:Java修炼指南博客园:https://home.cnblogs.com/u/wuyx/CSDN: https://mp.csdn.net/简书:https://www.jianshu.c ...
- kotlin函数的参数和返回值
fun main(arg: Array<String>) { val asList = asList(, , , , , ) println(asList) } fun <T> ...