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
when exporting this module to dict / anything else - i want to exclude some_flag from the output.
I know it can be done through the export in the dict method - but this class is a subclass in a more complex model, and i don't want the user of the class to decide what to exclude.
Note - i'm using this flag for some inner calculations.
The text was updated successfully, but these errors were encountered:
Hello @arielb135
Currently it's not possible without overriding dict method (or any other workaround).
But I think support of private attributes or having a special value of dump alias (like dump_alias=None) to exclude fields would be two viable solutions.
Both solutions may be included in pydantic 1.7 if everything goes well.
WDYT ?
Basically, i have the following model:
when exporting this module to dict / anything else - i want to exclude some_flag from the output.
I know it can be done through the export in the dict method - but this class is a subclass in a more complex model, and i don't want the user of the class to decide what to exclude.
Note - i'm using this flag for some inner calculations.
The text was updated successfully, but these errors were encountered: