Browse Source

clean up imports

master
MasterofJOKers 11 years ago
parent
commit
a059e69dff
  1. 4
      k4ever/transaction/admin.py
  2. 6
      k4ever/transaction/forms.py
  3. 7
      k4ever/transaction/models.py
  4. 2
      k4ever/transaction/urls.py
  5. 3
      k4ever/transaction/validator.py
  6. 11
      k4ever/transaction/views.py

4
k4ever/transaction/admin.py

@ -6,9 +6,11 @@ @@ -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']

6
k4ever/transaction/forms.py

@ -7,11 +7,13 @@ @@ -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 <Transaction>` with a currency field. """
amount = CurrencyField(label='Betrag')

7
k4ever/transaction/models.py

@ -6,16 +6,17 @@ @@ -6,16 +6,17 @@
#
# Licensed under GNU Affero General Public License v3 or later
from decimal import Decimal
from django.db import models
from django.core.validators import *
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 decimal import Decimal
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

2
k4ever/transaction/urls.py

@ -5,7 +5,7 @@ @@ -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('',

3
k4ever/transaction/validator.py

@ -5,9 +5,10 @@ @@ -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") :

11
k4ever/transaction/views.py

@ -5,14 +5,15 @@ @@ -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):

Loading…
Cancel
Save