List(type=Enum(...)) not supported

Bug #136806 reported by Marc Tardif
2
Affects Status Importance Assigned to Milestone
Storm
Fix Released
Undecided
James Henstridge

Bug Description

When attempting to set a variable of the following type:

  List(type=Enum(map={"a": 1}))

The attached error is returned. The problem seems to be in the set() method of the Variable base class:

                new_value = self._parse_set(value, from_db)
                if from_db:
                    # Prepare it for being used by the hook below.
                    value = self._parse_get(new_value, False)

So, if from_db is set, the the _parse_set method of the EnumVariable class will return "a" for "a". However, since from_db is set, then the same "a" value will be passed to the _parse_get method which will not be found in the _get_map dictionary.

Related branches

Revision history for this message
Marc Tardif (cr3) wrote :
Changed in storm:
assignee: nobody → jamesh
status: New → In Progress
Revision history for this message
James Henstridge (jamesh) wrote :

Fix merged to trunk in r301.

Changed in storm:
status: In Progress → Fix Committed
Changed in storm:
milestone: none → 0.15
Jamu Kakar (jkakar)
Changed in storm:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.