You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a situation where a user needs to define a template structure for something. Based on the data in this first JSONField, I am able to create a new schema dynamically, derived from the user input into the first model.
The thing now is that I want to set this derived schema to be the Schema for a JSONField of the instance of another Model (which has a foreignkey to the first model). Is this possible in any way? I found it hard to implement since:
field =JSONField(schema = my_schema)
Is declared class-wise for the model. Is there any way to change the schema of the JSONField of an instance of a model containing a django-jsonform JSONField? Otherwise, is there a workaround for this?
The text was updated successfully, but these errors were encountered:
I was able to solve this by reading about callable schemas as described in a previous issue. I did however use the hacky version and could not find a cleaner implementation in the docs.
I have a situation where a user needs to define a template structure for something. Based on the data in this first JSONField, I am able to create a new schema dynamically, derived from the user input into the first model.
The thing now is that I want to set this derived schema to be the Schema for a JSONField of the instance of another Model (which has a foreignkey to the first model). Is this possible in any way? I found it hard to implement since:
field =JSONField(schema = my_schema)
Is declared class-wise for the model. Is there any way to change the schema of the JSONField of an instance of a model containing a django-jsonform JSONField? Otherwise, is there a workaround for this?
The text was updated successfully, but these errors were encountered: