opensupplyhub / open-apparel-registry

An application for searching, matching, uploading factories.
MIT License
32 stars 13 forks source link

Improve searchability of contributor drop down (admin site) #1643

Closed mariel-oar closed 2 years ago

mariel-oar commented 2 years ago

Overview

In the admin site, there are several pages that have a contributor drop down field (e.g. Source page - https://openapparel.org/admin/api/source/). When the items in the dropdown are viewed, there seems to be no order to how the items are displayed. This creates issues in using the tool given the growing number of contributors.

Proposal: update the display of the items in the dropdown to be either alphabetical or chronological, based on their associated number that identifies the sequence in which they were added to the OAR.

If it is straightforward, it would be ideal that the dropdown be searchable with partial-matches enabled.

Demo: The drop down in question appears on this page when you click on a specific source: https://openapparel.org/admin/api/source/341398/change/

mariel-oar commented 2 years ago

Screen Shot 2022-02-11 at 12 53 52 PM

jwalgran commented 2 years ago

I estimated this as a :one: since the Django admin provides a method for sorting the options list

https://docs.djangoproject.com/en/2.2/ref/contrib/admin/#django.contrib.admin.ModelAdmin.formfield_for_foreignkey