Skip to content
Snippets Groups Projects
Commit d51c989c authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

Task #8291: added rootDirectoriesForSite select method

parent 53962691
No related branches found
No related tags found
No related merge requests found
......@@ -244,6 +244,14 @@ class LTAStorageDb:
join directory dir on dir.id = storage_site_root.directory_id
join storage_site site on site.id = storage_site_root.storage_site_id''').fetchall()
def rootDirectoriesForSite(self, site_id):
'''returns list of all root directories (id, name) for given site_id'''
with sqlite3.connect(self.db_filename) as conn:
return conn.execute('''SELECT dir.id, dir.name
FROM storage_site_root
join directory dir on dir.id = storage_site_root.directory_id
where storage_site_root.storage_site_id = ?''', [site_id]).fetchall()
def subDirectories(self, directory_id, depth = 1, includeSelf=False):
'''returns list of all sub directories up to the given depth (id, name, site_id, site_name, depth) for the given directory_id'''
with sqlite3.connect(self.db_filename) as conn:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment