Cannot use a Media object as a search query

I cannot search for rows where a media column is not None. Is this a bug or intentional?

for c in app_tables.my_table.search(my_media=q.not_(None)):
     print("never prints, exception raised")

Hi woodpav! I had a similar problem the other day.
I was using media objects to perform a search but it suddenly stopped working (I think) so I solved it by creating a filename column and search using this filename.
In my case it worked well because I was not expecting duplicated filenames, maybe you can use another file attribute.
Good luck!

Hi @woodpav,

You should be able to search for rows where a media column is not None - moving to bug reports.

2 Likes

I’ve just hit this one. Is it still WIP?

Workaround using a generator:

I’ve moved this thread to Feature Requests because it wasn’t actually a bug at the time.

But being able to query on whether a Media object is or is not None is something we could now implement.

2 Likes