mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #22 from SchrodingersGat/master
Code fix and simplify API URLs
This commit is contained in:
commit
2db39aaaa6
@ -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'))
|
||||
]
|
@ -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
|
||||
|
@ -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')),
|
||||
|
@ -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())
|
||||
]
|
@ -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())
|
||||
]
|
||||
|
@ -1,6 +0,0 @@
|
||||
from django.conf.urls import url
|
||||
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
]
|
Loading…
Reference in New Issue
Block a user