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'm looking to selectively return some urls based on the current state of the object and am having a heck of a time solving how to expose the state property in the Schema, do some logic and determine which URLs to return based on the object state:
The Model:
class Car(Model):
model = Column(String)
year = Column(String)
running = Column(Boolean) #'0 = not running', '1 = running'
What i'd like to do is have the start url only returned when the 'running' property is 0, and the stop url returned when it's 1, but i'm unclear on how to accomplish this.
Marshmallow seems to have a few decorators that would seem to but how would I leverage them with flask-marshmallow?
The text was updated successfully, but these errors were encountered:
The pass_original option is only really necessary if the condition requires data that was excluded by the schema. If you can, you may want to avoid it when working with lists due to marshmallow-code/marshmallow#315.
I'm looking to selectively return some urls based on the current state of the object and am having a heck of a time solving how to expose the state property in the Schema, do some logic and determine which URLs to return based on the object state:
The Model:
and the schema:
What i'd like to do is have the start url only returned when the 'running' property is 0, and the stop url returned when it's 1, but i'm unclear on how to accomplish this.
Marshmallow seems to have a few decorators that would seem to but how would I leverage them with flask-marshmallow?
The text was updated successfully, but these errors were encountered: