Commit Graph

3 Commits

Author SHA1 Message Date
Ben Busby
74e9317053
Override __str__ for endpoint f-strings
By default, f-strings use __str__ not __repr__, unless supplied with a
"!r" at the end of the str. Rather than going through and making the
strings work for the overridden __repr__ for endpoints, it's easier just
to convert the method over to __str__.

Also cleaned up some broken routes and formatting.
2021-11-16 20:05:42 -07:00
Ben Busby
ba7409f230
Refactor app to use enum constants for endpoints
Simplifying routing a bit helps me to check which endpoint the user is
visiting. Also will make it a lot easier down the road to rewrite,
whenever I get around to renaming "autocomplete" to a more appropriate
name (like "suggestion" or something).
2021-11-16 18:46:37 -07:00
Ben Busby
21012f5265
Feature: autocomplete/search suggestions (#72)
Basic autocomplete/search suggestion functionality added

* Adds new GET and POST routes for '/autocomplete' that accept a string query and returns an array of suggestions

* Adds new autoscript.js file for handling queries on the main page and results view

* Updated requests class to include autocomplete method

* Updated opensearch template to handle search suggestions

* Added header template to allow for autocomplete on results view

* Updated readme to mention autocomplete feature
2020-05-24 14:03:11 -06:00