def __init__(self, resource_group_id=None, url=u'', format=u'', description=u'', hash=u'', extras=None, **kwargs): self.id = _types.make_uuid() if resource_group_id: self.resource_group_id = resource_group_id self.url = url self.format = format self.description = description self.hash = hash # The base columns historically defaulted to empty strings # not None (Null). This is why they are seperate here. base_columns = ['url', 'format', 'description', 'hash'] for key in set(CORE_RESOURCE_COLUMNS) - set(base_columns): setattr(self, key, kwargs.pop(key, None)) self.extras = extras or {} extra_columns = self.get_extra_columns() for field in extra_columns: value = kwargs.pop(field, None) if value is not None: setattr(self, field, value) if kwargs: raise TypeError('unexpected keywords %s' % kwargs)
def __init__(self, user_id, search_string): self.id = _types.make_uuid() self.timestamp = datetime.datetime.utcnow() self.user_id = user_id self.last_run = None self.search_string = search_string self.last_results = []
def __init__(self, user_id, object_id, activity_type, data=None): self.id = _types.make_uuid() self.timestamp = datetime.datetime.utcnow() self.user_id = user_id self.object_id = object_id self.activity_type = activity_type if data is None: self.data = {} else: self.data = data
def __init__(self, user_id, object_id, revision_id, activity_type, data=None): self.id = _types.make_uuid() self.timestamp = datetime.datetime.now() self.user_id = user_id self.object_id = object_id self.revision_id = revision_id self.activity_type = activity_type if data is None: self.data = {} else: self.data = data
def __init__(self, resource_group_id=None, url=u'', format=u'', description=u'', hash=u'', extras=None, **kwargs): self.id = make_uuid() if resource_group_id: self.resource_group_id = resource_group_id self.url = url self.format = format self.description = description self.hash = hash self.extras = extras or {} extra_columns = self.get_extra_columns() for field in extra_columns: value = kwargs.pop(field, None) if value is not None: setattr(self, field, value) if kwargs: raise TypeError('unexpected keywords %s' % kwargs)
def __init__(self, url=u"", format=u"", description=u"", hash=u"", extras=None, package_id=None, **kwargs): self.id = _types.make_uuid() self.url = url self.format = format self.description = description self.hash = hash self.package_id = package_id # The base columns historically defaulted to empty strings # not None (Null). This is why they are seperate here. base_columns = ["url", "format", "description", "hash"] for key in set(CORE_RESOURCE_COLUMNS) - set(base_columns): setattr(self, key, kwargs.pop(key, None)) self.extras = extras or {} extra_columns = self.get_extra_columns() for field in extra_columns: value = kwargs.pop(field, None) if value is not None: setattr(self, field, value) if kwargs: raise TypeError("unexpected keywords %s" % kwargs)
def __init__(self, name): self.id = _types.make_uuid() self.name = name
def __init__(self, name): self.id = make_uuid() self.name = name