Skip to content
Snippets Groups Projects
  1. Nov 06, 2023
  2. Oct 13, 2023
    • Konrad Mohrfeldt's avatar
      feat: add OrderFilter component · ceab432a
      Konrad Mohrfeldt authored
      This component implements the logic for the standard
      django-rest-framework (DRF) order parameter.
      
      DRF uses plan field names for ascending and a "-" prefix for descending
      order.
      
      Example:
      	if you’d want to sort by id you’d write:
      		?order=id
      	if you’d want to sort by id in reverse order you’d write:
      		?order=-id
      
      The OrderFilter supports arbitrary order fields, allows you to set the
      sort direction (ascending, descending – configurable per order field)
      and supports re-ordering of order fields so that that hierarchical
      orders can be set.
      ceab432a
Loading