kartoza / django-bims

https://testing.healthyrivers.kartoza.com
GNU Affero General Public License v3.0
12 stars 19 forks source link

Add option to filter taxon manager tags with OR and AND #4001

Closed dimasciput closed 2 months ago

dimasciput commented 3 months ago

We need to add an option to filter tags using either OR or AND logic in our application. Currently, the filtering mechanism does not support this feature.

The ticket request was created from this comment https://github.com/kartoza/django-bims/issues/3631#issuecomment-2149818590

dimasciput commented 3 months ago

@schmikloi @helendallas

image

You can now filter tags using OR or AND.

schmikloi commented 3 months ago

hi @dimasciput thanks! works properly!

helendallas commented 3 months ago

@dimasciput @schmikloi I ran this but not working for me?

Original request was: if I filter for two tags, they are combined with an OR (so I get all freshwater and all limno-terrestrial); can we implment an option that we combine the tags with an AND, so that I get only those which have both tags?

I did this filter

Screenshot 2024-06-20 at 09 57 31

But got all freshwater and tag 2 returned. Not only the taxa that had both tags.

Screenshot 2024-06-20 at 09 57 46
dimasciput commented 3 months ago

@helendallas could you hard refresh first?

schmikloi commented 3 months ago

hmm that is my result for OR

Bildschirmfoto 2024-06-20 um 10 41 34

and for AND

Bildschirmfoto 2024-06-20 um 10 41 49
helendallas commented 3 months ago

Weird. I did a hard refresh. and same result. I also tried @schmikloi test, and got all. I am on safari - not sure if that has anything to do with it?

dimasciput commented 3 months ago

@helendallas did you click apply when you change the OR to AND?

helendallas commented 3 months ago

yes, I clicked Apply

schmikloi commented 3 months ago

Weird. I did a hard refresh. and same result. I also tried @schmikloi test, and got all. I am on safari - not sure if that has anything to do with it?

I am also on Safari

helendallas commented 3 months ago

@dimasciput How do I edit tags at a global level. So there is Fresh water and Freshwater, but I can't find Fresh Water to delete. Is there a place to manage tags at a BIMS level?

dimasciput commented 3 months ago

@helendallas, you can go to the admin page to edit the tags at this link.

Tags are not at a global level, so different tenants can have different tags. However, in the future, when species are fetched from other tenants, their tags will also be imported.

dimasciput commented 3 months ago

It seems the 'fresh water' tag is added by Tim https://fada.sta.do.kartoza.com/admin/taggit/tag/65/change/.

helendallas commented 3 months ago

Thanks @dimasciput Curious where all the existing tags come from?

schmikloi commented 3 months ago

@helendallas Tim added "fresh water" when he was showing the recent developments to us, I added "freshwater" and "limbo-terrestic" as these terms are used for FADA

helendallas commented 2 months ago

Closing ticket now as working for me as well.

schmikloi commented 2 months ago

Dear sender,

I am attending various conferences and also will be on vacation. I will be able to respond reliably only after August 11th. In urgent cases, please feel free to send me a reminder. Thanks for your understanding!

Have a great summer! Astrid