如果我在Django模型中有一个CharField,并且尝试使用LIKE操作符的字符串模式过滤它,如:Django返回错误:
django.core.exceptions.FieldError: Unsupported lookup 'like' for CharField or join on the field但是,如果我使用manage.py dbshel
我用一段JSON代码在Django中做了一个like按钮,但是我一直得到“NoReverseMatch ".In urls.py和models.py,我展示了所有的代码,在views.py中只有like按钮和导入的方法,在detail.html中只有HTML标签用于like按钮和JSON脚本。from django.contrib.auth.models import User
from django.template.defaultfilters import slugify