from django.conf.urls import patterns, url

from .models import Bag, BagMaterial
from .views import BagMaterialsListView, BagMaterialDetailView, BagMaterialCreateView, BagMaterialUpdateView
from .views import BagsListView, BagDetailView, BagUpdateView, BagCreateView, BagBatchCreateView


urlpatterns = patterns('',

                       url(regex=r'^$',
                           view=BagsListView.as_view(),
                           name=Bag.overview_url),

                       url(regex=r'^(?P<pk>\d+)/$',
                           view=BagDetailView.as_view(),
                           name=Bag.detail_url),

                       url(regex=r'^create/$',
                           view=BagCreateView.as_view(),
                           name=Bag.create_url),

                       url(regex=r'^update/(?P<pk>\d+)/$',
                           view=BagUpdateView.as_view(),
                           name=Bag.update_url),

                       url(regex=r'^bagmaterial/$',
                           view=BagMaterialsListView.as_view(),
                           name=BagMaterial.overview_url),

                       url(regex=r'^bagmaterial/(?P<pk>\d+)/$',
                           view=BagMaterialDetailView.as_view(),
                           name=BagMaterial.detail_url),

                       url(regex=r'^bagmaterial/update/(?P<pk>\d+)/$',
                           view=BagMaterialUpdateView.as_view(),
                           name=BagMaterial.update_url),

                       url(regex=r'^bagmaterial/create/$',
                           view=BagMaterialCreateView.as_view(),
                           name=BagMaterial.create_url),

                       url(regex=r'^bagbatch/$',
                           view=BagBatchCreateView.as_view(),
                           name='bag batch create'),

)


