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
def __init__(self, *args, **kwds): self.years_vocabulary = kwds['years_vocabulary'] del kwds['years_vocabulary'] Field.__init__(self, *args, **kwds)
def __init__(self, schema, **kw): self.schema = schema _Field.__init__(self, **kw)