def validate(self, value):
    if value is not None and not isinstance(value, ByteString):
      try:
        value = ByteString(value)
      except TypeError, err:
        raise BadValueError('Property %s must be convertible '
                            'to a ByteString instance (%s)' % (self.name, err))
    value = super(ByteStringProperty, self).validate(value)
    if value is not None and not isinstance(value, ByteString):
      raise BadValueError('Property %s must be a ByteString instance'
                          % self.name)
    return value
A custom event handler which handles LayoutRequest events.
dataset/ETHPy150Open CollabQ/CollabQ/.google_appengine/google/appengine/ext/db/__init__.py/ByteStringProperty.validate--crossover with--dataset/ETHPy150Open ContinuumIO/ashiba/enaml/enaml/qt/qt_notebook.py/QNotebook.event