flask filtering + test db structure