Source

django-pim / pcbank / urls.py

Full commit
# -*- coding: utf-8 -*-
from django.conf.urls.defaults import patterns, url
from pcbank.models import Income, CreditCard, Payee, Bill, Bank, Transaction, Roommate, RoommateBill,\
    Cheque
from pcbank.forms import NewBillForm, NewChequeForm
from pcbank.feeds import BankingBookmarks
from pcbank.views import ChequeDetail

urlpatterns = patterns('pcbank.views',
    (r'^$', 'overview'),
    url(r'^Income/add.py$', 'create', {'model':Income}, name='add-income'),
    url(r'^Income/$', 'show_list', {'queryset':Income.objects.filter(active=True)}, name='list-income'),
    url(r'^Income/(?P<object_id>\d+)/edit.py$', 'update', {'model':Income}, name='edit-income'),
    url(r'^Income/(?P<object_id>\d+)/$', 'details', {'queryset':Income.objects.all()}, name='view-income'),
    url(r'^CreditCard/add.py$', 'create', {'model':CreditCard}, name='add-cc'),
    url(r'^CreditCard/$', 'show_list', {'queryset':CreditCard.objects.filter(active=True)}, name='list-cc'),
    url(r'^CreditCard/(?P<object_id>\d+)/edit.py$', 'update', {'model':CreditCard}, name='edit-cc'),
    url(r'^CreditCard/(?P<object_id>\d+)/$', 'details', {'queryset':CreditCard.objects.all()}, name='view-cc'),
    url(r'^Payee/add.py$', 'create', {'model':Payee}, name='add-payee'),
    url(r'^Payee/$', 'show_list', {'queryset':Payee.objects.filter(active=True)}, name='list-payee'),
    url(r'^Payee/(?P<object_id>\d+)/edit.py$', 'update', {'model':Payee}, name='edit-payee'),
    url(r'^Payee/(?P<object_id>\d+)/$', 'details', {'queryset':Payee.objects.all(), 'extra_context':{'form':NewBillForm()}}, name='view-payee'),
    url(r'^Bill/add.py$', 'create', {'model':Bill}, name='add-bill'),
    url(r'^Bill/$', 'show_list', {'queryset':Bill.objects.filter(paid=False)}, name='list-bill'),
    url(r'^Bill/(?P<object_id>\d+)/edit.py$', 'update', {'model':Bill}, name='edit-bill'),
    url(r'^Bill/(?P<object_id>\d+)/$', 'details', {'queryset':Bill.objects.all()}, name='view-bill'),
    url(r'^Bank/add.py$', 'create', {'model':Bank}, name='add-bank'),
    url(r'^Bank/$', 'show_list', {'queryset':Bank.objects.filter(active=True)}, name='list-bank'),
    url(r'^Bank/(?P<object_id>\d+)/edit.py$', 'update', {'model':Bank}, name='edit-bank'),
    url(r'^Bank/(?P<object_id>\d+)/$', 'details', {'queryset':Bank.objects.all()}, name='view-bank'),
    url(r'^Transaction/$', 'show_list', {'queryset':Transaction.objects.all(),'paginate_by':20}, name='list-transaction'),
    url(r'^Transaction/(?P<object_id>\d+)/$', 'details', {'queryset':Transaction.objects.all()}, name='view-transaction'),
    url(r'^ChequeBook/$', 'show_list', {'queryset':Cheque.objects.all()}, name='list-cheques'),
    url(r'^ChequeBook/add.py$', 'create', {'model':Cheque, 'form_class':NewChequeForm}, name='add-cheque'),
    url(r'^ChequeBook/(?P<cheque_id>\d+)/assign_transaction.py$', 'assign_transaction', name='assign-transaction'),
    url(r'^ChequeBook/(?P<slug>\d+)/$', ChequeDetail.as_view(), name='view-cheque'),
    url(r'^ChequeBook/(?P<cheque_id>\d+)/upload_cheque.py$', 'upload_cheque', name='upload-cheque'),
    url(r'^Roommate/add.py$', 'create', {'model':Roommate}, name='add-roommate'),
    url(r'^Roommate/$', 'show_list', {'queryset':Roommate.objects.filter(active=True)}, name='list-roommate'),
    url(r'^Roommate/(?P<object_id>\d+)/edit.py$', 'update', {'model':Roommate}, name='edit-roommate'),
    url(r'^Roommate/(?P<object_id>\d+)/$', 'details', {'queryset':Roommate.objects.all()}, name='view-roommate'),
    url(r'^RoommateBill/$', 'show_list', {'queryset':RoommateBill.objects.all()}, name='list-roommatebill'),
    url(r'^RoommateBill/(?P<object_id>\d+)/$', 'details', {'queryset':RoommateBill.objects.all()}, name='view-roommatebill'),
    (r'^CreditCard/table.py$', 'credit_table'),
    (r'^Bill/table.py$', 'bill_table'),
    (r'^Bill/(?P<object_id>\d+)/mark_paid.py$', 'mark_paid'),
    (r'^Income/(?P<object_id>\d+)/payday.py$', 'payday'),
    (r'^Bill/(?P<object_id>\d+)/bank_payment.py$', 'make_bank_payment'),
    (r'^Bill/(?P<object_id>\d+)/cc_payment.py$', 'make_cc_payment'),
    (r'^Payee/(?P<object_id>\d+)/add_bill.py$', 'add_bill'),
    (r'^Roommate/(?P<object_id>\d+)/add_bill.py$', 'add_roommatebill'),
    (r'^RoommateBill/(?P<object_id>\d+)/payment.py$', 'roommate_payment'),
    url(r'^Bank/(?P<object_id>\d+)/transfer.py$', 'bank_transfer', name='bank-transfer'),
    url(r'^MonthlyBudget.py$', 'monthly_budget', name='monthly-budget'),
    (r'^Service.py$', 'json_service'),
    (r'^Bookmarks.rss$', BankingBookmarks()),
)