Marshmallow and Enums

26 views
Skip to first unread message

Luis Enrique Pettinari

unread,
Mar 17, 2024, 9:17:07 AMMar 17
to Spring4D
Hi! I'm searching for an ORM framework to use in my project, so I'm trying Marshmallow. One thing on my project that was not easy to do with Marshmallow is the fact that Enums are mapped to the DB using char fields, one or two characters in most of the cases. Currently I'm using helpers to deal with that. I've defined a helper for every Enum type to return the corresponding string value to each Enum value, and vice versa. I didn't find a way to do that in Marshmallow, so I did some changes, in order to Marsmallow call a custom method, like a component event, and in that method is made the mapping.
If you are interested in I can make my solution available to you, so you can review, suggest improvement or just sugest another solution.

Best regards,
Luis Enrique
Reply all
Reply to author
Forward
0 new messages