Commit 3f8fa927 authored by Ryan Herbert's avatar Ryan Herbert
Browse files

sample_set.py, sample_set_list.py sample_set/all filter by tag

parent 9bfa7511
......@@ -164,7 +164,7 @@ def all():
page = int(request.vars['page'])
step = 50
list = SampleSetList(type, page, step)
list = SampleSetList(type, page, step, tag=request.vars['tag'])
list.load_creator_names()
list.load_sample_information()
list.load_config_information()
......
class SampleSetList():
def __init__(self, type, page=None, step=None):
def __init__(self, type, page=None, step=None, tag=None):
self.type = type
limitby = None
if page is not None and step is not None:
limitby = (page*step, (page+1)*step+1) # one more element to indicate if another page exists
query = (auth.vidjil_accessible_query(PermissionEnum.read.value, db[type]))
if tag is not None:
query = (query
& (db.tag.name == tag)
& (db.tag_ref.tag_id == db.tag.id)
& (db.tag_ref.table_name == self.type)
& (db.tag_ref.record_id == db[type].id))
query_gss = db(
(auth.vidjil_accessible_query(PermissionEnum.read.value, db[type]))
query
).select(
db[type].ALL,
limitby = limitby,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment