Skip to content

Commit

Permalink
switched to using new urls.path() from Django 2
Browse files Browse the repository at this point in the history
  • Loading branch information
moltob committed Dec 16, 2017
1 parent be7dd0b commit 8899b39
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 43 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## Unreleased
### Added

- Internal package updates, in particluar updated to Django 2.0.

## 4.3.1
### Added
Expand Down
7 changes: 3 additions & 4 deletions bizwiz/accounts/urls.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
from django.conf.urls import url, include
from django.contrib.auth import views as auth_views
from django.urls import reverse_lazy
from django.urls import path

from bizwiz.accounts.forms import login_helper

app_name = 'accounts'

urlpatterns = [
url(r'^login/$', auth_views.LoginView.as_view(
path('login/', auth_views.LoginView.as_view(
template_name='accounts/login.html',
extra_context={'helper': login_helper},
), name='login'),
url(r'^logout/$', auth_views.LogoutView.as_view(), name='logout'),
path('logout/', auth_views.LogoutView.as_view(), name='logout'),
]
10 changes: 5 additions & 5 deletions bizwiz/articles/urls.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from django.conf.urls import url
from django.urls import path

from bizwiz.articles import views

app_name = 'articles'

urlpatterns = [
url(r'^$', views.List.as_view(), {'show_inactive': True}, name='list'),
url(r'^active/$', views.List.as_view(), {'show_inactive': False}, name='list_active'),
url(r'^create/$', views.Create.as_view(), name='create'),
url(r'^edit/(?P<pk>[0-9]+)/$', views.Update.as_view(), name='update'),
path('', views.List.as_view(), {'show_inactive': True}, name='list'),
path('active/', views.List.as_view(), {'show_inactive': False}, name='list_active'),
path('create/', views.Create.as_view(), name='create'),
path('edit/<int:pk>/', views.Update.as_view(), name='update'),
]
8 changes: 4 additions & 4 deletions bizwiz/common/urls.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from django.conf.urls import url
from django.urls import path

from bizwiz.common import views

app_name = 'common'

urlpatterns = [
url(r'^$', views.Welcome.as_view(), name='index'),
url(r'^changelog$', views.Changelog.as_view(), name='changelog'),
url(r'^session-filter/$', views.SessionFilter.as_view(), name='session-filter'),
path('', views.Welcome.as_view(), name='index'),
path('changelog/', views.Changelog.as_view(), name='changelog'),
path('session-filter/', views.SessionFilter.as_view(), name='session-filter'),
]
8 changes: 4 additions & 4 deletions bizwiz/customers/urls.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from django.conf.urls import url
from django.urls import path

from bizwiz.customers import views

app_name = 'customers'

urlpatterns = [
url(r'^$', views.List.as_view(), name='list'),
url(r'^create/$', views.Create.as_view(), name='create'),
url(r'^edit/(?P<pk>[0-9]+)/$', views.Update.as_view(), name='update'),
path('', views.List.as_view(), name='list'),
path('create/', views.Create.as_view(), name='create'),
path('edit/<int:pk>/', views.Update.as_view(), name='update'),
]
20 changes: 10 additions & 10 deletions bizwiz/invoices/urls.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from django.conf.urls import url
from django.urls import path

from bizwiz.invoices import views

app_name = 'invoices'

urlpatterns = [
url(r'^$', views.List.as_view(), name='list'),
url(r'^payable/$', views.List.as_view(), {'subset': 'payable'}, name='list_payable'),
url(r'^taxable/$', views.List.as_view(), {'subset': 'taxable'}, name='list_taxable'),
url(r'^create/$', views.Create.as_view(), name='create'),
url(r'^edit/(?P<pk>[0-9]+)/$', views.Update.as_view(), name='update'),
url(r'^print/invoice-(?P<number>[0-9]+).pdf$', views.Print.as_view(), name='print'),
url(r'^sales/$', views.Sales.as_view(), name='sales'),
url(r'^sales/(?P<year>\d{4})/$', views.List.as_view(), {'subset': 'year_paid'}, name='sales'),
url(r'^sales/(?P<year>\d{4})/articles/$', views.ArticleSales.as_view(), name='sales_articles'),
path('', views.List.as_view(), name='list'),
path('payable/', views.List.as_view(), {'subset': 'payable'}, name='list_payable'),
path('taxable/', views.List.as_view(), {'subset': 'taxable'}, name='list_taxable'),
path('create/', views.Create.as_view(), name='create'),
path('edit/<int:pk>/', views.Update.as_view(), name='update'),
path('print/invoice-<int:number>.pdf', views.Print.as_view(), name='print'),
path('sales/', views.Sales.as_view(), name='sales'),
path('sales/<int:year>/$', views.List.as_view(), {'subset': 'year_paid'}, name='sales'),
path('sales/<int:year>/articles/$', views.ArticleSales.as_view(), name='sales_articles'),
]
8 changes: 4 additions & 4 deletions bizwiz/projects/urls.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from django.conf.urls import url
from django.urls import path

from bizwiz.projects import views

app_name = 'projects'

urlpatterns = [
url(r'^$', views.List.as_view(), name='list'),
url(r'^create/$', views.Create.as_view(), name='create'),
url(r'^edit/(?P<pk>[0-9]+)/$', views.Update.as_view(), name='update'),
path('', views.List.as_view(), name='list'),
path('create/', views.Create.as_view(), name='create'),
path('edit/<int:pk>/', views.Update.as_view(), name='update'),
]
4 changes: 2 additions & 2 deletions bizwiz/rebates/urls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from django.conf.urls import url
from django.urls import path

from bizwiz.rebates import views

app_name = 'rebates'

urlpatterns = [
url(r'^$', views.Update.as_view(), {'subset': None}, name='update'),
path('', views.Update.as_view(), {'subset': None}, name='update'),
]
21 changes: 11 additions & 10 deletions bwsite/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""

from django.conf.urls import url, include
from django.conf.urls import include
from django.contrib import admin
from django.urls import path

urlpatterns = [
url(r'^', include('bizwiz.common.urls')),
url(r'^accounts/', include('bizwiz.accounts.urls')),
url(r'^articles/', include('bizwiz.articles.urls')),
url(r'^customers/', include('bizwiz.customers.urls')),
url(r'^invoices/', include('bizwiz.invoices.urls')),
url(r'^projects/', include('bizwiz.projects.urls')),
url(r'^rebates/', include('bizwiz.rebates.urls')),
url(r'^admin/', admin.site.urls),
]
path('', include('bizwiz.common.urls')),
path('accounts/', include('bizwiz.accounts.urls')),
path('articles/', include('bizwiz.articles.urls')),
path('customers/', include('bizwiz.customers.urls')),
path('invoices/', include('bizwiz.invoices.urls')),
path('projects/', include('bizwiz.projects.urls')),
path('rebates/', include('bizwiz.rebates.urls')),
path('admin/', admin.site.urls),
]

0 comments on commit 8899b39

Please sign in to comment.