Merge pull request #22 from SchrodingersGat/master

Code fix and simplify API URLs
This commit is contained in:
Oliver 2017-04-11 09:59:42 +10:00 committed by GitHub
commit 2db39aaaa6
6 changed files with 13 additions and 40 deletions

View File

@ -1,12 +0,0 @@
from django.conf.urls import url, include
from django.contrib import admin
admin.site.site_header = "InvenTree Admin"
urlpatterns = [
url(r'^stock/', include('stock.urls')),
url(r'^part/', include('part.api_urls')),
url(r'^supplier/', include('supplier.urls')),
url(r'^track/', include('track.urls')),
url(r'^project/', include('project.api_urls'))
]

View File

@ -77,6 +77,9 @@ class InvenTreeTree(models.Model):
contents = ContentType.objects.get_for_model(type(self))
children = contents.get_all_objects_for_this_type(parent=self.id)
for child in children:
child.getUniqueChildren(unique)
return unique
@property

View File

@ -4,7 +4,6 @@ from django.contrib import admin
admin.site.site_header = "InvenTree Admin"
urlpatterns = [
url(r'^api/', include('InvenTree.api_urls')),
url(r'^stock/', include('stock.urls')),
url(r'^part/', include('part.urls')),
url(r'^supplier/', include('supplier.urls')),

View File

@ -1,17 +0,0 @@
from django.conf.urls import url
from . import views
urlpatterns = [
# Display part detail
url(r'^(?P<pk>[0-9]+)/$', views.PartDetail.as_view()),
# Display a single part category
url(r'^category/(?P<pk>[0-9]+)/$', views.PartCategoryDetail.as_view()),
# Display a list of top-level categories
url(r'^category/$', views.PartCategoryList.as_view()),
# Display list of all parts
url(r'^$', views.PartList.as_view())
]

View File

@ -3,9 +3,15 @@ from django.conf.urls import url
from . import views
urlpatterns = [
# part landing page
url(r'^$', views.part_index),
# Display part detail
url(r'^(?P<pk>[0-9]+)/$', views.PartDetail.as_view()),
# part category landing page
url(r'^category/$', views.category_index)
# Display a single part category
url(r'^category/(?P<pk>[0-9]+)/$', views.PartCategoryDetail.as_view()),
# Display a list of top-level categories
url(r'^category/$', views.PartCategoryList.as_view()),
# Display list of all parts
url(r'^$', views.PartList.as_view())
]

View File

@ -1,6 +0,0 @@
from django.conf.urls import url
from . import views
urlpatterns = [
]