def validate(self, value):
     if value is not None and not isinstance(value, Flow):
         raise db.BadValueError('Property %s must be convertible '
                                'to a FlowThreeLegged instance (%s)' %
                                (self.name, value))
     return super(FlowProperty, self).validate(value)
示例#2
0
    def validate(self, value):
        if value is not None and not isinstance(value, (dict, list, tuple)):
            raise db.BadValueError('Property %s must be a dict, list or '
                                   'tuple.' % self.name)

        return value
示例#3
0
 def __init__(self, *args, **kwargs):
     if 'key' not in kwargs and 'key_name' not in kwargs:
         raise db.BadValueError('key_name must be email address')
     super(SubscriptionStateEntity, self).__init__(*args, **kwargs)
示例#4
0
 def validate(self, value):
     if not isinstance(value, dict):
         raise db.BadValueError(
             'Property %s needs to be convertible to a dict instance (%s) of class dict'
             % (self.name, value))
     return super(DictProperty, self).validate(value)
示例#5
0
 def validate(self, value):
     if value is not None and not isinstance(value, client.Flow):
         raise db.BadValueError(
             'Property {0} must be convertible '
             'to a FlowThreeLegged instance ({1})'.format(self.name, value))
     return super(FlowProperty, self).validate(value)