0
,我試圖用like field
查詢dtabase,但我得到的錯誤
FieldError: Join on field 'car' not permitted. Did you misspell 'like' for the lookup type?
我是uisng是代碼
def formfield_for_manytomany(self, db_field, request, **kwargs):
if db_field.name == "cars":
kwargs["queryset"] = models.Cars.objects.filter(car_like="ford")
return super(MyAdmin, self).formfield_for_manytomany(db_field, request, **kwargs)