Filter by jsonb converted to text, using cast in filter

I need to convert the following sql statement to the django equivalent but I can’t find a way to use the cast function in the filter.

SELECT x, y
FROM my_model
WHERE z::text LIKE ‘%w%’;

The z field is of type jsonb and the database is postgressql.
I want to be able to search the json type column for any text, regardless of whether it is a key or a value, I do not know the names of the keys in advance.

To directly answer your stated question, you could annotate the queryset with a field created by using the Cast function to create a CharField version of the JSONField, then using filter on the annotated field.
(I suspect there may be a more “native” method of doing this using the PostgreSQL jsonb functions, but if so, I’m not aware of it.)