Package Camelot :: Package camelot :: Package view :: Package controls :: Package editors :: Module onetomanychoiceseditor |
[frames] | no frames]

# Source Code for Module Camelot.camelot.view.controls.editors.onetomanychoiceseditor

     1

     2  from camelot.view.model_thread import post
     3  from choiceseditor import ChoicesEditor
     4

     5 -class OneToManyChoicesEditor(ChoicesEditor):
     6

     7 -    def __init__(self, parent, editable=True, target=None, **kwargs):
     8          ChoicesEditor.__init__(self, parent, editable, **kwargs)
     9          assert target!=None
    10

    11          def get_choices():
    12              return [(o, unicode(o)) for o in target.query.all()]
    13

    14          post(get_choices, self.set_choices)
    15