Comments (3)
A comprehensive error is like so:
tortoise.exceptions.FieldError: Unknown filter param 'charup'. Allowed values are ['char', 'char__contains', 'char__endswith', 'char__gt', 'char__gte', 'char__icontains', 'char__iendswith', 'char__in', 'char__isnull', 'char__istartswith', 'char__lt', 'char__lte', 'char__not', 'char__not_in', 'char__not_isnull', 'char__startswith', 'char_null', 'char_null__contains', 'char_null__endswith', 'char_null__gt', 'char_null__gte', 'char_null__icontains', 'char_null__iendswith', 'char_null__in', 'char_null__isnull', 'char_null__istartswith', 'char_null__lt', 'char_null__lte', 'char_null__not', 'char_null__not_in', 'char_null__not_isnull', 'char_null__startswith', 'id', 'id__contains', 'id__endswith', 'id__gt', 'id__gte', 'id__icontains', 'id__iendswith', 'id__in', 'id__isnull', 'id__istartswith', 'id__lt', 'id__lte', 'id__not', 'id__not_in', 'id__not_isnull', 'id__startswith']
Its a very verbose, and that is for 3 fields only... But correct...
A version showing the base fields:
tortoise.exceptions.FieldError: Unknown filter param 'charup'. Allowed base values are ['char', 'char_null', 'id']
And much shorter, but a bit of a lie, as we don't show the filters...
To be even more helpful we could show the fields filters if you use an invalid filter?
@Zeliboba5 What do you think?
I also realised that the set of eligible values contains filters that make no sense, e.g. __is_null
on non-nullable fields, __contains
__beginswith
etc on integers? So we could reduce that set by a bit.
from tortoise-orm.
I was thinking more about the second option showing only base fields. "subfilters" can be added and deduced from this list by the user. I think the important thing is that the user can easily correct is code after seeing this message.
from tortoise-orm.
Thanks @jrmi For reporting on these "paper cut" level issues. 👍 It is a thing that OSS projects often suffer on.
This will be fixed for v0.10.10
from tortoise-orm.
Related Issues (20)
- Connection closes if save method was triggered in pytest.
- Can't use check field name HOT 1
- Tortoise ORM tutorial missing context? HOT 4
- Tortoise orm F expression
- Docs request: if `pk` will be unique HOT 1
- Updating config at runtime
- Meta indexes are not created safely
- mssql named instance port number
- Add support for composite primary keys and foreign keys
- Corrupt sql generated when bulk_create method is configured with on_conflict parameter
- https://tortoise.github.io/0.19.1 gives 404 HOT 1
- model relationship bugged HOT 8
- why are there three files for one database? HOT 1
- auto_now not working HOT 2
- Field 'DatetimeField' has error when I use '__year' or '__month'. report this:" 'int' object has no attribute 'utcoffset' " HOT 1
- Tortoise ORM integration with FastAPI lifespan ('NoneType' object is not iterable) HOT 4
- update(balance=Wallet.balance+1) how to do this? HOT 1
- Req: concurrent use of multiple databases
- model.update_or_create KeyError HOT 3
- Bug: Pydantic 2.7 broke `pydantic_model_creator` HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tortoise-orm.