Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add field during runtime? #185

Open
Chetchaiyan opened this issue Feb 21, 2023 · 1 comment
Open

How to add field during runtime? #185

Chetchaiyan opened this issue Feb 21, 2023 · 1 comment

Comments

@Chetchaiyan
Copy link

Chetchaiyan commented Feb 21, 2023

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
Copy link
Collaborator

ADR-007 commented Mar 1, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants