Closed tcouch closed 6 months ago
A couple of things I've noticed trying this out on preprod:
Maybe a better approach would be to do something like:
# Given a query like "varro disciplinae 12" this would be split into a list of terms: ["varro", "disciplinae"]
antiquarians = Antiquarian.objects.none()
works = Work.objects.none()
for term in search_terms:
works = works.union(Work.objects.filter(name__icontains=term))
antiquarians = antiquarians.union(Antiquarian.objects.filter(name__icontains=term))
# Return all fragments linked to any of the matching works or antiquarians
fragments = Fragment.objects.filter(
Q(antiquarian_fragmentlinks__work__in=works) |
Q(antiquarian_fragmentlinks__antiquarian__in=antiquarians)
)
# Also handle order number and unknowns...
After talking to researchers, they seem happy with the functionality of just a name and number, closing unless otherwise requested
The form to add a fragment link to an anonymous fragment is a simple drop down presenting all fragments which is very difficult to use now that the database has grown.
A solution would be to provide filters - Antiquarian and Work - in order to narrow down the number of items in the drop down. It's important that the results are also in numerical order as that will help quickly identify the right item.