clean up imports
This commit is contained in:
parent
7a86a28633
commit
a059e69dff
|
@ -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']
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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('',
|
||||
|
|
|
@ -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") :
|
||||
|
|
|
@ -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…
Reference in New Issue