Esempio n. 1
0
 def app_states(self):
     app = ISchoolToolApplication(None)
     container = IRelationshipStateContainer(app)
     states = container.get(self.view.app_states_name, None)
     if states is None:
         return {}
     return states
Esempio n. 2
0
 def app_states(self):
     app = ISchoolToolApplication(None)
     container = IRelationshipStateContainer(app)
     states = container.get(self.view.app_states_name, None)
     if states is None:
         return {}
     return states
Esempio n. 3
0
 def getVocabulary(self):
     app = ISchoolToolApplication(None)
     container = IRelationshipStateContainer(app)
     relationships = container.get(self.field.source)
     terms = [
         zope.schema.vocabulary.SimpleTerm(
             state, token=state.__name__, title=state.title)
         for state in relationships.states.values()]
     vocabulary = zope.schema.vocabulary.SimpleVocabulary(terms)
     return vocabulary
Esempio n. 4
0
 def getVocabulary(self):
     app = ISchoolToolApplication(None)
     container = IRelationshipStateContainer(app)
     relationships = container.get(self.field.source)
     terms = [
         zope.schema.vocabulary.SimpleTerm(state,
                                           token=state.__name__,
                                           title=state.title)
         for state in relationships.states.values()
     ]
     vocabulary = zope.schema.vocabulary.SimpleVocabulary(terms)
     return vocabulary
Esempio n. 5
0
 def states(self):
     if self.app_states_name is None:
         return None
     app = ISchoolToolApplication(None)
     container = IRelationshipStateContainer(app)
     return container.get(self.app_states_name, None)
Esempio n. 6
0
 def states(self):
     if self.app_states_name is None:
         return None
     app = ISchoolToolApplication(None)
     container = IRelationshipStateContainer(app)
     return container.get(self.app_states_name, None)