Convert V2's manifest endpoints to use the new data model interface

This commit is contained in:
Joseph Schorr 2018-10-05 17:30:47 -04:00
parent a172de4fdc
commit 6b5064aba4
10 changed files with 197 additions and 200 deletions

View file

@ -628,6 +628,15 @@ def get_active_tag_for_repo(repo, tag_name):
except RepositoryTag.DoesNotExist:
return None
def get_expired_tag_in_repo(repo, tag_name):
return (RepositoryTag
.select()
.where(RepositoryTag.name == tag_name, RepositoryTag.repository == repo)
.where(~(RepositoryTag.lifetime_end_ts >> None))
.where(RepositoryTag.lifetime_end_ts <= get_epoch_timestamp())
.get())
def get_possibly_expired_tag(namespace, repo_name, tag_name):
return (RepositoryTag
.select()