diff --git a/k4ever/transaction/admin.py b/k4ever/transaction/admin.py index 4b3fc05..4de287f 100644 --- a/k4ever/transaction/admin.py +++ b/k4ever/transaction/admin.py @@ -6,9 +6,11 @@ # # Licensed under GNU Affero General Public License v3 or later -from models import Transaction, TransactionType, VirtualTransaction from django.contrib import admin +from transaction.models import Transaction, TransactionType, VirtualTransaction + + class TransactionAdmin(admin.ModelAdmin): list_filter = ('transactionType','checked','user') #actions = ['really_delete_selected'] diff --git a/k4ever/transaction/forms.py b/k4ever/transaction/forms.py index 0526ce4..3405b9d 100644 --- a/k4ever/transaction/forms.py +++ b/k4ever/transaction/forms.py @@ -7,11 +7,13 @@ # Licensed under GNU Affero General Public License v3 or later from django import forms -from models import Transaction, VirtualTransaction -from main.fields import CurrencyField from django.contrib.auth.models import User from django.core.exceptions import ValidationError +from main.fields import CurrencyField +from transaction.models import Transaction, VirtualTransaction + + class TransactionForm(forms.ModelForm): """ ModelForm for :class:`Transactions ` with a currency field. """ amount = CurrencyField(label='Betrag') diff --git a/k4ever/transaction/models.py b/k4ever/transaction/models.py index c14c012..72e1150 100644 --- a/k4ever/transaction/models.py +++ b/k4ever/transaction/models.py @@ -6,16 +6,17 @@ # # Licensed under GNU Affero General Public License v3 or later - -from django.db import models -from django.core.validators import * -from django.contrib.auth.models import User -from django.db.models.deletion import SET_NULL -from django.db.models.signals import pre_delete from decimal import Decimal +from django.core.validators import MinValueValidator +from django.contrib.auth.models import User +from django.db import models +from django.db.models.deletion import SET_NULL +from django.db.models.signals import pre_delete + from validator import validate_notZero + class TransactionType(models.Model): """ Type for a :class:`Transaction`. States how the money has been added to the account and if somebody needs to check diff --git a/k4ever/transaction/urls.py b/k4ever/transaction/urls.py index f898434..600c0b1 100644 --- a/k4ever/transaction/urls.py +++ b/k4ever/transaction/urls.py @@ -5,7 +5,7 @@ # # Licensed under GNU Affero General Public License v3 or later -from django.conf.urls.defaults import * +from django.conf.urls.defaults import patterns urlpatterns = patterns('', diff --git a/k4ever/transaction/validator.py b/k4ever/transaction/validator.py index 03c5703..b9abd93 100644 --- a/k4ever/transaction/validator.py +++ b/k4ever/transaction/validator.py @@ -5,9 +5,10 @@ # # Licensed under GNU Affero General Public License v3 or later -from django.core.exceptions import ValidationError from decimal import Decimal +from django.core.exceptions import ValidationError + def validate_notZero(value): if value == Decimal("0.0") : diff --git a/k4ever/transaction/views.py b/k4ever/transaction/views.py index 54bc963..8166347 100644 --- a/k4ever/transaction/views.py +++ b/k4ever/transaction/views.py @@ -5,14 +5,15 @@ # # Licensed under GNU Affero General Public License v3 or later -from django.shortcuts import render_to_response -from django.template import RequestContext from django.contrib.auth.decorators import login_required from django.db.models import Q from django.http import HttpResponseRedirect -from models import Transaction, TransactionType, VirtualTransaction -from forms import TransactionForm, VirtualTransactionForm -import datetime +from django.shortcuts import render_to_response +from django.template import RequestContext + +from transaction.forms import TransactionForm, VirtualTransactionForm +from transaction.models import Transaction, VirtualTransaction + @login_required def overview(request):