Warehouse: Search filters put 'Programming Language :: Python :: N :: Only' checkboxes in an odd place

Created on 29 Apr 2018  路  6Comments  路  Source: pypa/warehouse

The search-filter checkboxes are sorting the Programming Language :: Python :: N :: Only checkboxes below all of the respective N.n checkboxes, instead of placing them immediately below the N checkboxes:

more logical place for the checkboxes

This is highly nonintuitive, at least to me.

This may be low priority given that, e.g., #2442 and/or #3462 would presumably change the UI considerably.

CSSCSS HTML bug help needed

Most helpful comment

This seems to have resolved itself. https://pypi.org/search/?q= currently shows the following:

Screen Shot 2020-04-02 at 9 41 42 PM

All 6 comments

I second this. Only checkbox is a bit confusing. As @bskinn mentioned we should probably place Only below 2 and 3.

@nlhkabu do you want me to have a look at it?

The root cause seems to be the default ordering of Postgres' text fields.

Example:

SELECT classifier FROM mytable ORDER BY classifier;

Output:

Python :: 2 
Python :: 2.7 
Python :: 2 :: Only 

Looks like the collation "ucs_basic" (mentioned here as a SQL standard, but not default in PG, for UTF-8: https://www.postgresql.org/docs/10/static/collation.html) returns the strings in the order we'd prefer:

SELECT classifier FROM mytable ORDER BY classifier COLLATE ucs_basic ;

Output:

Python :: 2 
Python :: 2 :: Only 
Python :: 2.7 

What's the better idea? Simply change the query in the one place (does sqlalchemy support that somehow) or migrate the database field to always order by this collation?

Amazing @hellp !

@dstufft is this something for you to look at?

This seems to have resolved itself. https://pypi.org/search/?q= currently shows the following:

Screen Shot 2020-04-02 at 9 41 42 PM

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mahmoud picture mahmoud  路  4Comments

webknjaz picture webknjaz  路  4Comments

apogoreliy picture apogoreliy  路  4Comments

gautamkrishnar picture gautamkrishnar  路  4Comments

hartwork picture hartwork  路  4Comments