Override field-level exclude #4899
-
I may be missing something obvious, but I cannot find a way to include a field exporting a model (e.g., using dict()) if that field has been marked for exclusion in the model definition using the Field function. Here is a working example of what I've tried:
In other words, once a field has been marked as excluded in the model definition, I have found no way to override that setting and include it with the model export. Is there a way to do this? Or is there some other approach (other than explicitly passing the list of fields to exclude every time I export the model, which does not work in my use case)? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
This is not my area of expertise, but I had an idea you might try. Can you change the configuration setting for that field and then invoke the “model_rebuild()” method on your model? I don’t recall if that’s the exact name of the method, but it’s similar. Hope that works for you and let me know. |
Beta Was this translation helpful? Give feedback.
-
I think this isn't possible in v1, it will be possible in V2. |
Beta Was this translation helpful? Give feedback.
I think this isn't possible in v1, it will be possible in V2.