Skip to content
This repository has been archived by the owner on Mar 22, 2018. It is now read-only.

Commit

Permalink
associate the bauble searches to the clickable labels.
Browse files Browse the repository at this point in the history
close #244
  • Loading branch information
mfrasca committed Jan 2, 2016
1 parent 9d6ecca commit 5dafd0e
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions bauble/plugins/plants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,45 +119,65 @@ def __init__(self):
'genus where not species = Empty'))

utils.make_label_clickable(
self.widgets.splash_nspcuse,
self.widgets.splash_nspctot,
lambda *a: bauble.gui.send_command(
'species where not accessions = Empty'))
'species like %'))

utils.make_label_clickable(
self.widgets.splash_nspctot,
self.widgets.splash_nspcuse,
lambda *a: bauble.gui.send_command(
'species like %'))
'species where not accessions = Empty'))

utils.make_label_clickable(
self.widgets.splash_naccuse,
self.widgets.splash_nspcnot,
lambda *a: bauble.gui.send_command(
'accession where plants.quantity>0'))
'species where accessions = Empty'))

utils.make_label_clickable(
self.widgets.splash_nacctot,
lambda *a: bauble.gui.send_command(
'accession like %'))

utils.make_label_clickable(
self.widgets.splash_npltuse,
self.widgets.splash_naccuse,
lambda *a: bauble.gui.send_command(
'accession where plants.quantity>0'))

utils.make_label_clickable(
self.widgets.splash_naccnot,
lambda *a: bauble.gui.send_command(
'plant where quantity>0'))
'accession where plants = Empty or sum(plants.quantity)=0'))

utils.make_label_clickable(
self.widgets.splash_nplttot,
lambda *a: bauble.gui.send_command(
'plant like %'))

utils.make_label_clickable(
self.widgets.splash_nlocuse,
self.widgets.splash_npltuse,
lambda *a: bauble.gui.send_command(
'plant where sum(quantity)>0'))

utils.make_label_clickable(
self.widgets.splash_npltnot,
lambda *a: bauble.gui.send_command(
'location where plants.id != 0'))
'plant where sum(quantity)=0'))

utils.make_label_clickable(
self.widgets.splash_nloctot,
lambda *a: bauble.gui.send_command(
'location like %'))

utils.make_label_clickable(
self.widgets.splash_nlocuse,
lambda *a: bauble.gui.send_command(
'location where sum(plants.quantity)>0'))

utils.make_label_clickable(
self.widgets.splash_nlocnot,
lambda *a: bauble.gui.send_command(
'location where plants is Empty or sum(plants.quantity)=0'))

for i in range(1, 11):
wname = "stqr_%02d_button" % i
widget = getattr(self.widgets, wname)
Expand Down

0 comments on commit 5dafd0e

Please sign in to comment.