mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Sort currency API
This commit is contained in:
parent
873faee040
commit
6752bdc1c6
@ -5,7 +5,7 @@ Provides a JSON API for common components.
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from rest_framework import permissions, generics
|
||||
from rest_framework import permissions, generics, filters
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
@ -27,7 +27,11 @@ class CurrencyList(generics.ListCreateAPIView):
|
||||
permissions.IsAuthenticated,
|
||||
]
|
||||
|
||||
ordering_fields = ['name', 'value']
|
||||
filter_backends = [
|
||||
filters.OrderingFilter,
|
||||
]
|
||||
|
||||
ordering_fields = ['suffix', 'value']
|
||||
|
||||
|
||||
common_api_urls = [
|
||||
|
@ -15,6 +15,9 @@
|
||||
|
||||
$("#currency-table").bootstrapTable({
|
||||
url: "{% url 'api-currency-list' %}",
|
||||
queryParams: {
|
||||
ordering: 'suffix'
|
||||
},
|
||||
sortable: true,
|
||||
search: true,
|
||||
formatNoMatches: function() { return "No currencies found"; },
|
||||
@ -38,14 +41,17 @@
|
||||
{
|
||||
field: 'suffix',
|
||||
title: 'Currency',
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
field: 'description',
|
||||
title: 'Description',
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
field: 'value',
|
||||
title: 'Value',
|
||||
sortable: true,
|
||||
}
|
||||
]
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user