Bauble / bauble.classic

this is how Bauble and Ghini both started
GNU General Public License v2.0
10 stars 34 forks source link

usage of the Empty token is not documented #236

Closed mfrasca closed 8 years ago

mfrasca commented 8 years ago

in a comment to #36 , @RoDuth suggests

I would like to be able to search for the blanks, if that makes sense? i.e. what accessions do I have that don't have a verification level recorded, or don't have any vouchers yet or haven't got label distributions or a source or provenance data, etc. etc. I've tried accession where prov_type = "None" and other similar approaches but I just get errors. There most probably is a way to do it I just don't know what it is.

apart from None and Empty, which are two reserved literals in the queries, so they will work if you do not quote them, this is an issue I should have risen myself, I've been trying to get the queries right in the home screen recently and it does not really work, let's see if I can explain what happens.

I want to select all accessions without living plants. without plants means either not connected to plant objects at all, or only dead plants. only dead plants is easy, we use quantity=0 but without plants?

the 'cuchubo' database: 525 accession like % 516 accession where plants.id>0 514 accession where plants.quantity>0 2 accession where plants.quantity=0

how do I select the remaining 9?

oops. I know!

accession where plants = Empty and the converse: accession where not plants = Empty

mfrasca commented 8 years ago

to complete the above: accession where not plants.quantity>0 is the 11 accessions without living plants.

RoDuth commented 8 years ago

An issue with the query builder also then? My accession where prov_type = "None" was generated by it (with the quotations), by not selecting anything in the drop down list for prov_type.

Would be good to have a "Dictionary" of sorts for the search entry field. Until I saw you mention :config recently I had no idea it existed... It may not do much but it is handy.

mfrasca commented 8 years ago

@RoDuth ... where's your user who would help document things! :smiling_imp:

RoDuth commented 8 years ago

Alas, away for the xmas break! I will speak to them again in a few weeks.

mfrasca commented 8 years ago

if you type Empty in the RHS value field of the QueryBuilder, the QueryBuilder will know you need to compare a set, not a scalar, so it will skip the last field of what you selected on the LHS. so you construct accession where plants.id = Empty and the QueryBuilder will produce accession where plants = Empty

it is a work-around, I agree totally. the better option would be to let you select the set itself and allowing only the RHS value Empty and only the comparison operations == and !=.

mfrasca commented 8 years ago

@RoDuth , your volunteered documentation editors? :bow:

RoDuth commented 8 years ago

Looks like its going to be me! (using some of their guidance material they have written for themselves) We are in the process of a massive audit of the older collection and they are, as such, fully occupied.

I'll look into it this weekend... Its bauble.classic-docs.i18n I need to make the edits to right? Haven't looked at it yet but I'm assuming it's fairly straight forward?

mfrasca commented 8 years ago

where we keep the documentation. this should also be part of the documentation. :grimacing:

the project you point at (bauble.classic-docs.i18n) is not the documentation project, it's its internationalization (i18n) part. and you would probably not want to edit it directly, but every time you do edit the docs, you need update the i18n files, and commit them, so weblate will receive them. here too: something we need document.

I did not immediately realize when I copied Bauble into Ghini, but the doc sources are inside of the software, in the doc folder. so at the moment they are both in bauble.classic/doc and in ghini.desktop/doc. I did register a http://ghini.readthedocs.org site, but I would not want to go through all configuration steps again, in particular regarding weblate (even though I'm not so happy with the current set-up so I do plan to ask Michal Čihar to help again). In any case, I'd rather just keep one documentation site which would acknowledge the existence of both bauble and ghini (like http://ghini.github.io does), and if @brettatoms agrees, it could be bauble.readthedocs.org. I would see how to make ghini on readthedocs point to bauble. otherwise I suggest we do that from ghini@readthedocs.

what you would do:

thinking of the automatic translation and weblate configuration:

As a matter of fact, a similar i18n post-edit process has to be run on the software as well, whenever one adds or edits gettext arguments and I seldom remember to do so. I should include it in some script which I do use regularly, like ./scripts/bump_version.py.

mfrasca commented 8 years ago

This issue was moved to Ghini/ghini.desktop#131