Hi,

Didn't try, but I think you should define your enum using the python
unicode style...

card_type = Enum(map={
            u'VISA': 1, u'MC': 2, u'LASER': 3, u'AMEX': 4,
            u'DINERS': 5, u'DELTA': 6, u'MAESTRO': 7
        })

Hope this helps



2013/4/3 Oscar Campos <[email protected]>

> Hi all.
>
> I have an enumeration defined in the usual way:
>     class Card(Storm):
>         __storm_table__ = 'b2c_credit_cards'
>         ...
>         card_type = Enum(map={
>             'VISA': 1, 'MC': 2, 'LASER': 3, 'AMEX': 4,
>             'DINERS': 5, 'DELTA': 6, 'MAESTRO': 7
>         })
>         ...
>
> If I create a new Card object I can flush the store and commit without
> any problem, of course I am able to use card.card_type = 'VISA' but when
> I try to load it from the database I always get a ValueError exception
> like "Invalid enum value u:'VISA' (or whatever other card type I did
> store first)"
>
> I'm using MySQL 5.1.66, Storm 0.19 and Python 2.7.3
>
> Someone have any idea about how to solve this?
>
> Best Regards.
>
> --
> storm mailing list
> [email protected]
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/storm
>



-- 
Vincent Alquier
[email protected]
-- 
storm mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/storm

Reply via email to