Skip to content
Advertisement

Django Filter for Model function

I am trying to filter through a TextField where I have stripped it of its HTML tags. However, it gives me this error: “Cannot resolve keyword ‘search’ into field.” Here is my code:

models.py

JavaScript

views.py

JavaScript

Is there a way to do this?

Advertisement

Answer

I just found a way to get what I’m aiming at. All I have to do is to override the “save” function, as so:

JavaScript

Thanks for your help.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement