Luke Elam

Results 9 comments of Luke Elam

> Related code as below: > > ```python > class Sys_Role(MyAbstractBaseModel): > """角色表""" > role_code = CharField(max_length=128, description="角色代码", null=False, unique=True) > role_name = CharField(max_length=128, description="角色名称", null=False, unique=True) > status =...

Why not just use “PydanticMeta” on your User model? [PydanticMeta](https://tortoise-orm.readthedocs.io/en/latest/examples/pydantic.html?highlight=pydantic%20#pydanticmeta-callables) This would look something like: ```python class User(models.Model): id = fields.IntField(pk=True) username = fields.CharField(max_length=128, index=True, unique=True) email = fields.CharField(max_length=128, unique=True,...

```python From tortoise.expression import Q filters = [Q(Q(recipients__id=user_1.id) & Q(recipients__id=user_2.id))] await Channel.filter(*filters) ``` Would the above not work?

> I was wondering if Tortoise has support for Hybrid Methods/Properties such as [SQLAlchemy](https://docs.sqlalchemy.org/en/13/orm/extensions/hybrid.html) and [Pony](https://docs.ponyorm.org/entities.html#hybrid-methods-and-properties) does but couldn't find anything mentioned on the documentation and even roadmaps. It works...

Hi, Sorry to necro. I've been having this too, on a brand-new project (just playing around with Quasar). After having a little bit of a play around, for me, the...

> > I recently saw two projects solving this problem: > > > > * https://github.com/laurentS/slowapi > > * https://github.com/long2ice/fastapi-limiter > > **NOTE: Im aware of libraries made for handling...

> @hongquan @sinaso @jrmi @allrod5 @charleswhchan > hello, > > **Describe the bug** > When I use foreign key to filter the database table and then use annotate to get...

> In our project we use multiple MySQL schemas/databases. Now, the only way to access the data, is to create a separate 'app' record with their own connection: > >...

> 2\. If I don't set db name in the connection string, then the first query fails with "no database selected" error (a lack of `USE ` call. Okay, so...