[storm] Invalid enum value on find

Oscar Campos oscar.campos at open-phoenix.com
Wed Apr 3 14:38:57 UTC 2013


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.



More information about the storm mailing list