Skip to content

Mixed Classes in a DictProperty? #162

@ghost

Description

Wondering how can I mix different classes in a DictProperty. For example, in the example below I have 2 different classes that I would like to map to 'actions' DictProperty attribute.
Couldn't find any knob in the tests or documentation. Appreciate any comments about it.

# generic class
class Action(orm.JsonObject):
    pass
# action class 1
class EmailAction(Action):
    action = 'email'
    subject = orm.StringProperty()
    ...
# action class 2
class PagerAction(Action):
    action = 'pager'
    queues = orm.ListProperty(orm.StringProperty)
    ...
# using DictProperty to get it together
class Alert(orm.JsonObject):
    actions = orm.DictProperty(Action)
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions