clean up imports

This commit is contained in:
MasterofJOKers 2012-03-11 01:35:49 +01:00
parent 7a86a28633
commit a059e69dff
6 changed files with 23 additions and 16 deletions

View File

@ -6,9 +6,11 @@
# #
# Licensed under GNU Affero General Public License v3 or later # Licensed under GNU Affero General Public License v3 or later
from models import Transaction, TransactionType, VirtualTransaction
from django.contrib import admin from django.contrib import admin
from transaction.models import Transaction, TransactionType, VirtualTransaction
class TransactionAdmin(admin.ModelAdmin): class TransactionAdmin(admin.ModelAdmin):
list_filter = ('transactionType','checked','user') list_filter = ('transactionType','checked','user')
#actions = ['really_delete_selected'] #actions = ['really_delete_selected']

View File

@ -7,11 +7,13 @@
# Licensed under GNU Affero General Public License v3 or later # Licensed under GNU Affero General Public License v3 or later
from django import forms from django import forms
from models import Transaction, VirtualTransaction
from main.fields import CurrencyField
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from main.fields import CurrencyField
from transaction.models import Transaction, VirtualTransaction
class TransactionForm(forms.ModelForm): class TransactionForm(forms.ModelForm):
""" ModelForm for :class:`Transactions <Transaction>` with a currency field. """ """ ModelForm for :class:`Transactions <Transaction>` with a currency field. """
amount = CurrencyField(label='Betrag') amount = CurrencyField(label='Betrag')

View File

@ -6,16 +6,17 @@
# #
# Licensed under GNU Affero General Public License v3 or later # 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 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 from validator import validate_notZero
class TransactionType(models.Model): class TransactionType(models.Model):
""" Type for a :class:`Transaction`. States how the money has """ Type for a :class:`Transaction`. States how the money has
been added to the account and if somebody needs to check been added to the account and if somebody needs to check

View File

@ -5,7 +5,7 @@
# #
# Licensed under GNU Affero General Public License v3 or later # 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('', urlpatterns = patterns('',

View File

@ -5,9 +5,10 @@
# #
# Licensed under GNU Affero General Public License v3 or later # Licensed under GNU Affero General Public License v3 or later
from django.core.exceptions import ValidationError
from decimal import Decimal from decimal import Decimal
from django.core.exceptions import ValidationError
def validate_notZero(value): def validate_notZero(value):
if value == Decimal("0.0") : if value == Decimal("0.0") :

View File

@ -5,14 +5,15 @@
# #
# Licensed under GNU Affero General Public License v3 or later # 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.contrib.auth.decorators import login_required
from django.db.models import Q from django.db.models import Q
from django.http import HttpResponseRedirect from django.http import HttpResponseRedirect
from models import Transaction, TransactionType, VirtualTransaction from django.shortcuts import render_to_response
from forms import TransactionForm, VirtualTransactionForm from django.template import RequestContext
import datetime
from transaction.forms import TransactionForm, VirtualTransactionForm
from transaction.models import Transaction, VirtualTransaction
@login_required @login_required
def overview(request): def overview(request):