2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-12-24 21:23:26 +00:00

Remove common_currency model entirely

- A lot of views / pages / etc needed to be updated too
- Now uses django-money fields entirely
- Create a manual rate exchange backend (needs more work!)
This commit is contained in:
Oliver Walters
2020-11-11 00:21:06 +11:00
parent 1fc2ef5f18
commit 4dff18e4a6
33 changed files with 194 additions and 422 deletions

View File

@@ -5,35 +5,5 @@ Provides a JSON API for common components.
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from rest_framework import permissions, generics, filters
from django.conf.urls import url
from .models import Currency
from .serializers import CurrencySerializer
class CurrencyList(generics.ListCreateAPIView):
""" API endpoint for accessing a list of Currency objects.
- GET: Return a list of Currencies
- POST: Create a new currency
"""
queryset = Currency.objects.all()
serializer_class = CurrencySerializer
permission_classes = [
permissions.IsAuthenticated,
]
filter_backends = [
filters.OrderingFilter,
]
ordering_fields = ['suffix', 'value']
common_api_urls = [
url(r'^currency/?$', CurrencyList.as_view(), name='api-currency-list'),
]