diff --git a/django/didgeridoo/currencies/forms.py b/django/didgeridoo/currencies/forms.py deleted file mode 100644 index 2dcee6a..0000000 --- a/django/didgeridoo/currencies/forms.py +++ /dev/null @@ -1,11 +0,0 @@ -from django import forms -from currencies.models import ExchangeRate_name - - -class CurrencyForm(forms.Form): - # https://bradmontgomery.net/blog/2008/11/24/a-simple-django-example-with-ajax/ - currencies = forms.ModelChoiceField( - queryset=ExchangeRate_name.objects.all()) - - CURRENCY_CHOICES = [(t.name, t.name) for t in - ExchangeRate_name.objects.all()] diff --git a/django/didgeridoo/currencies/models.py b/django/didgeridoo/currencies/models.py index 9f420fb..a5014f3 100644 --- a/django/didgeridoo/currencies/models.py +++ b/django/didgeridoo/currencies/models.py @@ -25,7 +25,3 @@ class ExchangeRate(models.Model): def __str__(self): return str(self.name) - - class Meta: - # https://simpleisbetterthancomplex.com/tips/2016/10/06/django-tip-17-earliest-and-latest.html - get_latest_by = 'name__name' diff --git a/django/didgeridoo/currencies/views.py b/django/didgeridoo/currencies/views.py index 6da8f88..33cabe1 100644 --- a/django/didgeridoo/currencies/views.py +++ b/django/didgeridoo/currencies/views.py @@ -1,12 +1,10 @@ from django.shortcuts import render from datetime import datetime from django.views.generic.edit import UpdateView -from django.core.urlresolvers import reverse_lazy from currencies.models import (ExchangeRate, ExchangeRate_date, ExchangeRate_name) from currencies import exchange_rates -from currencies.forms import CurrencyForm from django.http import JsonResponse