Hey, how do I create pydantic models for collections when $id is a field, because I can't use $id as a var name and Pydantic seems overly complex on trying to get it to work
class Standard(BaseModel):
id: str
standardCode: str
standardText: str
topics: List[str]
objectives: List[str]
class Config:
fields = { 'id': '$id' }
valid_data = Standard(data).dict(by_alias=True)
Sounds fine but this isn't really an Appwrite question. Maybe a pydantic forum might be more helpful
well
the problem is the id's are stored as $id
And?
Maybe you can look at field aliases: https://docs.pydantic.dev/latest/usage/fields/#field-aliases
I did that, it then complained that id wasn't being set or something, we messed with it for 30-45 minutes before giving up and ust removing the ID
I was posting here hoping someone had tried to use a JSON Serializable class with their database fields because.. that's how it should be done
Recommended threads
- help with domain cookie!
I'm having trouble with cookie domain configuration for cross-subdomain authentication. The session cookies are being scoped to the Appwrite endpoint domain ins...
- Second application got bricked after 1.7...
A few days ago I created this post https://discord.com/channels/564160730845151244/1072905050399191082/threads/1435303434495594698 where after the migration to ...
- Message: Invalid document structure: Unk...
Hi, I Restored my appwrite database and im facing this error.. im not able to do anything ``` [Error] Timestamp: 2025-11-09T11:59:47+00:00 [Error] Method: POS...