Commit 747b85c3 authored by HERBERT Ryan's avatar HERBERT Ryan

sample_set* filter last element

In order to be able to indicate whether another page is available, we
query one more item than we would like to display. Therefore we need to
filter out this last element.
parent 8d64f661
...@@ -14,10 +14,12 @@ class SampleSetList(): ...@@ -14,10 +14,12 @@ class SampleSetList():
orderby = ~db[type].id orderby = ~db[type].id
) )
step = len(query_gss) if step is None else step
auth.load_permissions(PermissionEnum.admin.value, type) auth.load_permissions(PermissionEnum.admin.value, type)
auth.load_permissions(PermissionEnum.anon.value, type) auth.load_permissions(PermissionEnum.anon.value, type)
self.elements = {} self.elements = {}
for row in query_gss: for i in range(0, min(len(query_gss), step)):
row = query_gss[i]
self.elements[row.id] = row self.elements[row.id] = row
self.elements[row.id].file_count = 0 self.elements[row.id].file_count = 0
self.elements[row.id].size = 0 self.elements[row.id].size = 0
...@@ -107,3 +109,6 @@ class SampleSetList(): ...@@ -107,3 +109,6 @@ class SampleSetList():
def get_values(self): def get_values(self):
return self.elements.values() return self.elements.values()
def __len__(self):
return len(self.element_ids)
...@@ -43,7 +43,8 @@ ...@@ -43,7 +43,8 @@
</thead> </thead>
{{for data in query :}} {{for i in range(0, min(len(query), step)) :}}
{{data = query[i]}}
<tr class="pointer" onclick="db.call('sample_set/index', {'id' :'{{=data.sample_set_id}}' , 'config_id' : {{=data.most_used_conf}} } )" > <tr class="pointer" onclick="db.call('sample_set/index', {'id' :'{{=data.sample_set_id}}' , 'config_id' : {{=data.most_used_conf}} } )" >
{{ for field in fields: }} {{ for field in fields: }}
<td> <td>
......
Markdown is supported
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