octabytes / FireO

Google Cloud Firestore modern and simplest convenient ORM package in Python. FireO is specifically designed for the Google's Firestore
https://fireo.octabyte.io
Apache License 2.0
247 stars 29 forks source link

How to add field during runtime? #185

Open Chetchaiyan opened 1 year ago

Chetchaiyan commented 1 year ago

Dear All,

I would like to add field during runtime for open-end data using in difference circumstance. Why not MapField? I might need to query on those fields as well.

Please advise

Best Regards, Chet Chetchaiyan

ADR-007 commented 1 year ago

Hi @Chetchaiyan,

AFAIK there is no official solution for it, but you can do something like this:

my_new_field = Field()
my_new_field.name = 'my_new_field'
my_new_field.contribute_to_model(MyModel, 'my_new_field')

But this is an internal API that can be changed without notifications.