You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromtortoiseimportModel, fields, run_asyncfromtortoise.contrib.testimportinit_memory_sqlitefromtortoise.fields.baseimportStrEnumclassMyModel(Model):
id=fields.IntField(pk=True)
name=fields.TextField()
classMyEnum(StrEnum):
A="a"@init_memory_sqliteasyncdefdo():
awaitMyModel.create(name="a")
qs=MyModel.filter(name=MyEnum.A)
qs._make_query()
print(qs.query)
# expected SELECT "id","name" FROM "mymodel" WHERE "name"='a'# actual SELECT "id","name" FROM "mymodel" WHERE "name"=aprint(awaitMyModel.filter(name=MyEnum.A).exists())
# expected True# actual raises tortoise.exceptions.OperationalError: no such column: arun_async(do())
Describe the bug
Reported here: tortoise/pypika-tortoise#7
To Reproduce
Expected behavior
Support filter by enum
Additional context
Will be fixed after this PR(tortoise/pypika-tortoise#10) merged.
The text was updated successfully, but these errors were encountered: