getting rid of clutter.

This commit is contained in:
Ivan Hörler 2018-01-21 22:47:14 +01:00
parent dba76057b3
commit 2f940e57c7
3 changed files with 0 additions and 17 deletions

View File

@ -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()]

View File

@ -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'

View File

@ -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