aboutsummaryrefslogtreecommitdiffstats
path: root/servo/urls
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2015-11-11 15:43:55 +0200
committerFilipp Lepalaan <filipp@mac.com>2015-11-11 15:43:55 +0200
commit19444b3b1c3d80b860d9d749942b7d2558950bcb (patch)
tree0942f5e005b7f607ee64d73978a6cf7912945adc /servo/urls
parentf51bc293756243e6880a1419a82fb51ea1733a30 (diff)
downloadServo-19444b3b1c3d80b860d9d749942b7d2558950bcb.tar.gz
Servo-19444b3b1c3d80b860d9d749942b7d2558950bcb.tar.bz2
Servo-19444b3b1c3d80b860d9d749942b7d2558950bcb.zip
Refactored searches into separate module
Diffstat (limited to 'servo/urls')
-rw-r--r--servo/urls/customer.py22
-rw-r--r--servo/urls/default.py1
-rw-r--r--servo/urls/device.py11
-rw-r--r--servo/urls/note.py1
-rw-r--r--servo/urls/order.py1
-rw-r--r--servo/urls/products.py21
-rw-r--r--servo/urls/sales.py1
-rw-r--r--servo/urls/search.py28
8 files changed, 33 insertions, 53 deletions
diff --git a/servo/urls/customer.py b/servo/urls/customer.py
index f029325..9665aaf 100644
--- a/servo/urls/customer.py
+++ b/servo/urls/customer.py
@@ -6,24 +6,30 @@ urlpatterns = patterns(
"servo.views.customer",
url(r'^$', 'index', {'group': 'all'}, name="customers-list_all"),
url(r'^find/$', 'find', name="customers-find"),
- url(r'^search/$', 'search', name="customers-search"),
url(r'^filter/$', 'filter', name="customers-filter"),
url(r'^download/$', 'download', name="customers-download"),
url(r'^download/(?P<group>[\w\-]+)/$', 'download', name="customers-download"),
url(r'^find/download$', 'download', name="customers-download_search"),
url(r'^groups/add/$', 'edit_group', name="customers-create_group"),
- url(r'^groups/(?P<group>[\w\-]+)/edit/$', 'edit_group', name="customers-edit_group"),
- url(r'^groups/(?P<group>[\w\-]+)/delete/$', 'delete_group', name="customers-delete_group"),
+ url(r'^groups/(?P<group>[\w\-]+)/edit/$', 'edit_group',
+ name="customers-edit_group"),
+ url(r'^groups/(?P<group>[\w\-]+)/delete/$', 'delete_group',
+ name="customers-delete_group"),
url(r'^(?P<group>[\w\-]+)/$', 'index', name="customers-list"),
url(r'^(?P<group>[\w\-]+)/upload/$', 'upload', name="customers-upload"),
url(r'^(?P<group>[\w\-]+)/add/$', 'edit', name="customers-create_customer"),
- url(r'^(?P<group>[\w\-]+)/(?P<pk>\d+)/$', 'view', name="customers-view_customer"),
- url(r'^(?P<group>[\w\-]+)/(?P<pk>\d+)/edit/$', 'edit', name="customers-edit_customer"),
- url(r'^(?P<group>[\w\-]+)/(?P<pk>\d+)/delete/$', 'delete', name="customers-delete_customer"),
+ url(r'^(?P<group>[\w\-]+)/(?P<pk>\d+)/$', 'view',
+ name="customers-view_customer"),
+ url(r'^(?P<group>[\w\-]+)/(?P<pk>\d+)/edit/$', 'edit',
+ name="customers-edit_customer"),
+ url(r'^(?P<group>[\w\-]+)/(?P<pk>\d+)/delete/$', 'delete',
+ name="customers-delete_customer"),
url(r'^(?P<pk>\d+)/move/$', 'move', name="customers-move_customer"),
- url(r'^(?P<pk>\d+)/move/(?P<new_parent>\d+)/$', 'move', name="customers-move_customer"),
+ url(r'^(?P<pk>\d+)/move/(?P<new_parent>\d+)/$', 'move',
+ name="customers-move_customer"),
url(r'^(?P<pk>\d+)/merge/$', 'merge', name="customers-merge_customer"),
- url(r'^(?P<pk>\d+)/merge/(?P<target>\d+)/$', 'merge', name="customers-merge_customer"),
+ url(r'^(?P<pk>\d+)/merge/(?P<target>\d+)/$', 'merge',
+ name="customers-merge_customer"),
url(r'^(?P<parent_id>\d+)/new/$', 'edit', name="customers-create_contact"),
url(r'^(\d+)/orders/(\d+)/$', 'add_order', name="customers-add_to_order"),
url(r'^(?P<pk>\d+)/notes/$', 'notes', name="customers-list_notes"),
diff --git a/servo/urls/default.py b/servo/urls/default.py
index 35c1f05..d70d295 100644
--- a/servo/urls/default.py
+++ b/servo/urls/default.py
@@ -49,5 +49,6 @@ urlpatterns = patterns(
(r'^kaboom/$', 'servo.views.error.report'),
url(r'^home/', include('servo.urls.account')),
+ url(r'^search/', include('servo.urls.search')),
)
diff --git a/servo/urls/device.py b/servo/urls/device.py
index defef62..04839dc 100644
--- a/servo/urls/device.py
+++ b/servo/urls/device.py
@@ -4,7 +4,6 @@ from django.conf.urls import patterns, url
from django.views.decorators.cache import cache_page
from servo.views.order import create
-from servo.views.device import get_gsx_search_results
from servo.views.diagnostics import diagnostics, select_test, run_test
@@ -12,7 +11,6 @@ urlpatterns = patterns(
"servo.views.device",
url(r'^$', 'index', name="devices-list"),
- url(r'^search/$', 'search'),
url(r'^find/$', "find", name="devices-find"),
url(r'^add/$', "edit_device", name="devices-add"),
@@ -27,14 +25,6 @@ urlpatterns = patterns(
url(r'^(?P<pk>\d+)/orders/(?P<order_id>\d+)/queue/(?P<queue_id>\d+)/parts/$',
"parts", name="devices-parts"),
- url(r'^search/gsx/(?P<what>\w+)/(?P<param>\w+)/(?P<query>[~\w\s,\-\(\)/\.]+)/$',
- "search_gsx",
- name="devices-search_gsx"),
-
- url(r'^search/gsx/(?P<what>\w+)/(?P<param>\w+)/(?P<query>[~\w\s,\-\(\)/\.]+)/$',
- cache_page(60*15)(get_gsx_search_results),
- name="devices-get_gsx_search_results"),
-
url(r'^choose/order/(\d+)/$', 'choose', name="devices-choose"),
url(r'^upload/$', 'upload_devices', name="devices-upload_devices"),
url(r'^(?P<device_id>\d+)/orders/create/$', create,
@@ -58,5 +48,4 @@ urlpatterns = patterns(
"delete_device",
name="devices-delete_device"),
- url(r'^search$', 'search', name="devices-search"),
)
diff --git a/servo/urls/note.py b/servo/urls/note.py
index 4057f40..0e1b65c 100644
--- a/servo/urls/note.py
+++ b/servo/urls/note.py
@@ -5,7 +5,6 @@ from django.conf.urls import patterns, url
urlpatterns = patterns(
"servo.views.note",
url(r'^$', 'list_notes', name="notes-list_notes"),
- url(r'^search/$', 'search', name="notes-search"),
url(r'^find/$', 'find', name="notes-find"),
url(r'^templates/$', 'templates'),
diff --git a/servo/urls/order.py b/servo/urls/order.py
index 39badfa..c2a49a6 100644
--- a/servo/urls/order.py
+++ b/servo/urls/order.py
@@ -12,7 +12,6 @@ urlpatterns = patterns(
url(r'^$', 'list_orders', name='orders-index'),
url(r'^\?queue=(?P<queue>\d+)$', 'list_orders', name='orders-list_queue'),
- url(r'^search/$', 'search', name="orders-search"),
url(r'^batch/$', 'batch_process', name="orders-batch_process"),
url(r'^download/$', 'download_results', name="orders-download_results"),
diff --git a/servo/urls/products.py b/servo/urls/products.py
index 9de2575..9c60baa 100644
--- a/servo/urls/products.py
+++ b/servo/urls/products.py
@@ -12,20 +12,18 @@ urlpatterns = patterns(
url(r'^upload/parts/$', "upload_gsx_parts", name="products-upload_gsx_parts"),
url(r'^update_price/(\d+)/$', "update_price", name="products-update_price"),
- url(r'^all/(?P<pk>\d+)/$', "view_product", {'group': 'all'}, name="products-view_product"),
+ url(r'^all/(?P<pk>\d+)/$', "view_product", {'group': 'all'},
+ name="products-view_product"),
url(r'^(?P<group>[\w\-/]*)/(?P<pk>\d+)/view/$', "view_product",
name="products-view_product"),
# Editing product categories
url(r'^categories/create/$', "edit_category", name="products-create_category"),
- url(r'^categories/(?P<slug>[\w\-]+)/edit/$',
- "edit_category",
+ url(r'^categories/(?P<slug>[\w\-]+)/edit/$', "edit_category",
name="products-edit_category"),
- url(r'^categories/(?P<slug>[\w\-]+)/delete/$',
- "delete_category",
+ url(r'^categories/(?P<slug>[\w\-]+)/delete/$', "delete_category",
name="products-delete_category"),
- url(r'^categories/(?P<parent_slug>[\w\-]+)/create/$',
- "edit_category",
+ url(r'^categories/(?P<parent_slug>[\w\-]+)/create/$', "edit_category",
name="products-create_category"),
# Editing products
@@ -37,15 +35,14 @@ urlpatterns = patterns(
name="products-delete_product"),
# Choosing a product for an order
- url(r'^choose/order/(?P<order_id>\d+)/$', "choose_product", name="products-choose"),
+ url(r'^choose/order/(?P<order_id>\d+)/$', "choose_product",
+ name="products-choose"),
url(r'^(?P<group>[\w\-]+)/(?P<code>[\w\-/]+)/create/$', "edit_product",
name="products-create"),
- url(r'^all/(?P<code>[\w\-/]+)/view/$',
- "view_product", {'group': 'all'},
+ url(r'^all/(?P<code>[\w\-/]+)/view/$', "view_product", {'group': 'all'},
name="products-view_product"),
- url(r'^(?P<code>[\w\-/]+)/new/$',
- "edit_product", {'group': None},
+ url(r'^(?P<code>[\w\-/]+)/new/$', "edit_product", {'group': None},
name="products-create"),
url(r'^code/(?P<code>[\w\-/]+)/location/(?P<location>\d+)/get_info/$',
diff --git a/servo/urls/sales.py b/servo/urls/sales.py
index 152a394..dd1d637 100644
--- a/servo/urls/sales.py
+++ b/servo/urls/sales.py
@@ -8,5 +8,4 @@ urlpatterns = patterns(
url(r'^purchases/', include('servo.urls.purchases')),
url(r'^shipments/', include('servo.urls.shipments')),
url(r'^invoices/', include('servo.urls.invoices')),
- url(r'^search/$', 'servo.views.product.search'),
)
diff --git a/servo/urls/search.py b/servo/urls/search.py
index 486bdcf..06278d6 100644
--- a/servo/urls/search.py
+++ b/servo/urls/search.py
@@ -3,27 +3,17 @@
from django.conf.urls import patterns, url
from django.views.decorators.cache import cache_page
-from servo.views.search import search_gsx
+from servo.views.search import search_gsx, get_gsx_search_results
urlpatterns = patterns(
"servo.views.search",
- url(r'^$', "spotlight",
- name="search-spotlight"),
- url(r'^gsx/(?P<what>\w+)/$', "list_gsx",
- name="search-gsx"),
- url(r'^gsx/(?P<what>\w+)/for/(?P<q>\w+)/$', "list_gsx",
- name="search-gsx"),
- # /search/gsx/parts/?productName=iPod+Shuffle...
- url(r'^gsx/(?P<what>\w+)/(?P<arg>\w+)/(?P<value>[~\w\s,\-\(\)/\.]+)/$',
- cache_page(60*15)(search_gsx),
+ url(r'^$', "spotlight", name="search-spotlight"),
+ url(r'^customers/$', "customers", name="search-customers"),
+ url(r'^devices/(?P<what>\w+)/(?P<param>\w+)/(?P<query>[~\w\s,\-\(\)/\.]+)/$',
+ "search_gsx",
name="search-search_gsx"),
- url(r'^gsx/(?P<what>\w+)/results/$', "view_gsx_results",
- name="search-gsx_results"),
- url(r'^notes/$', "list_notes"),
- url(r'^products/$', "list_products"),
- url(r'^orders/$', "list_orders"),
- url(r'^customers/$', "list_customers"),
- url(r'^devices/$', "list_devices"),
- url(r'^gsx/$', "list_gsx"),
- url(r'^articles/$', "list_articles"),
+ url(r'^gsx/(?P<what>\w+)/(?P<param>\w+)/(?P<query>[~\w\s,\-\(\)/\.]+)/$',
+ #cache_page(60*15)(get_gsx_search_results),
+ get_gsx_search_results,
+ name="search-get_gsx_search_results"),
)