# HG changeset patch # User Marcin Kuzminski # Date 1338998633 -7200 # Node ID e87c6aa9c5e77a27846a187aaef2a1cde9eb9c59 # Parent a8635cdab3c0f5011fa353566423a3173f876afd Add method for fetching repos by full path diff -r a8635cdab3c0 -r e87c6aa9c5e7 rhodecode/model/db.py --- a/rhodecode/model/db.py Wed Jun 06 17:55:19 2012 +0200 +++ b/rhodecode/model/db.py Wed Jun 06 18:03:53 2012 +0200 @@ -535,6 +535,11 @@ return q.scalar() @classmethod + def get_by_full_path(cls, repo_full_path): + repo_name = repo_full_path.split(cls.base_path(), 1)[-1] + return cls.get_by_repo_name(repo_name.strip(URL_SEP)) + + @classmethod def get_repo_forks(cls, repo_id): return cls.query().filter(Repository.fork_id == repo_id)