Skip to content

Commit

Permalink
put the first acidf value into Accession.code_format, if there is…
Browse files Browse the repository at this point in the history
… one.

otherwise leave it to the default value `%Y%PD####`
related to Bauble/bauble.classic#59
  • Loading branch information
mfrasca committed Jan 28, 2016
1 parent 3c07892 commit c24d733
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions bauble/plugins/garden/accession.py
Original file line number Diff line number Diff line change
Expand Up @@ -1922,10 +1922,13 @@ def populate_code_formats(self):
ls = self.view.widgets.acc_code_format_liststore
ls.clear()
ls.append([''])
for row in self.session.\
query(meta.BaubleMeta).\
filter(meta.BaubleMeta.name.like(u'acidf_%')).\
order_by(meta.BaubleMeta.name):
query = self.session.\
query(meta.BaubleMeta).\
filter(meta.BaubleMeta.name.like(u'acidf_%')).\
order_by(meta.BaubleMeta.name)
if query.count():
Accession.code_format = query.first().value
for row in query:
ls.append([row.value])

def on_acc_code_format_comboentry_changed(self, widget, *args):
Expand Down

0 comments on commit c24d733

Please sign in to comment.