예제 #1
0
    def __init__(self, value_type, vocabulary, **kw):
        
        # complain if value_type is not a field
        if value_type is not None and not IField.providedBy(value_type):#IGNORE:E1101
            raise ValueError("'value_type' must be field instance.")
        self.value_type = value_type
        self.vocabulary = None
        self.vocabularyName = None

        if isinstance(vocabulary, (unicode, str)):
            self.vocabularyName = vocabulary
        else: 
            assert (ISource.providedBy(vocabulary) or             #IGNORE:E1101
                    IContextSourceBinder.providedBy(vocabulary))  #IGNORE:E1101
            self.vocabulary = vocabulary
        self._init_field = bool(self.vocabularyName)
        Field.__init__(self, **kw)      # initializing List or Choice would mess up 
                                        # the vocabulary 
        self._init_field = False
예제 #2
0
 def __init__(self, *args, **kwds):
     self.years_vocabulary = kwds['years_vocabulary']
     del kwds['years_vocabulary']
     Field.__init__(self, *args, **kwds)
예제 #3
0
 def __init__(self, *args, **kwds):
     self.years_vocabulary = kwds['years_vocabulary']
     del kwds['years_vocabulary']
     Field.__init__(self, *args, **kwds)
예제 #4
0
 def __init__(self, schema, **kw):
     self.schema = schema
     _Field.__init__(self, **kw)