def get(id): asset = Asset.get_or_none(Asset.id == id) if asset: return asset.to_dict()
def get_by_url(url): return Asset.get_or_none(Asset.url == url)
def exists(id): return bool(Asset.get_or_none(Asset.id == id))