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
a field that converts to an int behind the scenes, but allows the live object to have a set of values, so you could do something like:
classFoo(Orm):
bar=EnumField("a", "b", "c", "d")
f=Foo()
f.bar= ["a", "b"]
f.save() # bar will save into the db as 3f2=f.query.get_pk(f.pk)
f2.bar# ["a", "b"]
So the enum field will set the appropriate field setters to make sure the the live orm always has a set of values, and that the db always gets the int, when it creates the field it takes the values you passed into it and sets their values in the order they are passed in, doubling the value as it goes, so
EnumField("a", "b", "c", "d")
a=1b=2c=4d=8
The text was updated successfully, but these errors were encountered:
a field that converts to an
int
behind the scenes, but allows the live object to have a set of values, so you could do something like:So the enum field will set the appropriate field setters to make sure the the live orm always has a set of values, and that the db always gets the int, when it creates the field it takes the values you passed into it and sets their values in the order they are passed in, doubling the value as it goes, so
The text was updated successfully, but these errors were encountered: