Skip to content
Snippets Groups Projects
  • Konrad Mohrfeldt's avatar
    ceab432a
    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
    History
    feat: add OrderFilter component
    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.