From 2f940e57c7b573101bf8ff089028e1adbf122f77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Ho=CC=88rler?= Date: Sun, 21 Jan 2018 22:47:14 +0100 Subject: [PATCH] getting rid of clutter. --- django/didgeridoo/currencies/forms.py | 11 ----------- django/didgeridoo/currencies/models.py | 4 ---- django/didgeridoo/currencies/views.py | 2 -- 3 files changed, 17 deletions(-) delete mode 100644 django/didgeridoo/currencies/forms.py 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