peewee select where not working when using a model instance rather than a model directly
问题 I have an instance of a peewee Model my_table = MyTable() from which I want to select some model instances. I don't understand why this works: In [0] [selection.p_name for selection in my_table.select() if selection.p_type == "Solar"] Out [0] ['Solar, photovoltaic', 'Solar, photovoltaic', 'Solar, photovoltaic', 'Solar, photovoltaic', 'Solar, concentrated solar power', 'Solar, concentrated solar power'] but this doesn't: In [1] selections = my_table.select().where(my_table.p_type=="Solar") In