According to the documentation, custom plurals are allowed ("mice" instead of "mouses").
Some of my tables are in another language (Dutch) so using the default plural logic of -s is not desired.
However, when I tried to
# works:
class User(BaseModel):
name = Field()
has_many(
'memberships',
{'groups': {'via': 'memberships'}}
)
# does not work:
class Group(BaseModel):
name: str = Field()
has_many(
'memberships',
{'my_users': {'via': 'memberships', "target": "User"}} # works when it's just users
)
class Membership(BaseModel):
belongs_to(
'user',
'group'
)
# fine:
db.User(id=1).groups()
# error:
db.Group(id=1).my_users()
According to the documentation, custom plurals are allowed ("mice" instead of "mouses"). Some of my tables are in another language (Dutch) so using the default plural logic of -s is not desired.
However, when I tried to
What am I doing wrong?