Permalink
Browse files

Moved wiki urls from urls.py base to urls.py inside wiki app

  • Loading branch information...
1 parent 703fcdd commit 203379d840c6966697781f703ef94609cbb476b4 @hermancaldara hermancaldara committed Aug 19, 2011
Showing with 30 additions and 19 deletions.
  1. +29 −0 apps/wiki/urls.py
  2. +1 −19 urls.py
View
@@ -0,0 +1,29 @@
+from django.conf.urls.defaults import patterns
+from django.views.generic.simple import direct_to_template
+from django.views.generic.create_update import update_object, delete_object
+
+from apps.wiki.models import WikiItem
+
+
+urlpatterns = patterns('apps.wiki.views',
+ (r'^$', 'show_all_wiki_items'),
+ (r'^(?P<wiki_item_id>\d+)/$', 'view_wiki_item'),
+ (r'^(?P<object_id>\d+)/editar/$', update_object,
+ {'model': WikiItem, 'template_name': 'edit_wiki_item.html',
+ 'post_save_redirect': '/wiki/item_editado_com_sucesso/'}
+ ),
+ (r'^item_editado_com_sucesso/$',
+ direct_to_template, {'template': 'wiki_item_successfully_updated.html'}
+ ),
+ (r'^(?P<object_id>\d+)/excluir/$', delete_object,
+ {'model': WikiItem, 'template_name': 'delete_wiki_item.html',
+ 'post_delete_redirect': '/wiki/item_excluido_com_sucesso/'}
+ ),
+ (r'^item_excluido_com_sucesso/$',
+ direct_to_template, {'template': 'wiki_item_successfully_deleted.html'}
+ ),
+ (r'^novo_item/$', 'add_wiki_item'),
+ (r'^novo_item/adicionado_com_sucesso/$',
+ direct_to_template, {'template': 'wiki_item_successfully_added.html'}
+ ),
+)
View
20 urls.py
@@ -1,11 +1,7 @@
from django.conf.urls.defaults import *
-from django.views.generic.simple import direct_to_template
-from django.views.generic.create_update import update_object, delete_object
from django.conf import settings
from django.contrib import admin
-from apps.wiki.models import WikiItem
-
admin.autodiscover()
@@ -31,21 +27,7 @@
(r'^ferramentas/$', 'apps.tools.views.show_all'),
(r'^ferramenta/(?P<tool_slug>[\w_-]+)$', 'apps.tools.views.show_tool'),
- (r'^wiki/$', 'apps.wiki.views.show_all_wiki_items'),
- (r'^wiki/(?P<wiki_item_id>\d+)/$', 'apps.wiki.views.view_wiki_item'),
- (r'^wiki/(?P<object_id>\d+)/editar/$', update_object,
- {'model': WikiItem, 'template_name': 'edit_wiki_item.html',
- 'post_save_redirect': '/wiki/item_editado_com_sucesso/'}),
- (r'^wiki/item_editado_com_sucesso/$',
- direct_to_template, {'template': 'wiki_item_successfully_updated.html'}),
- (r'^wiki/(?P<object_id>\d+)/excluir/$', delete_object,
- {'model': WikiItem, 'template_name': 'delete_wiki_item.html',
- 'post_delete_redirect': '/wiki/item_excluido_com_sucesso/'}),
- (r'^wiki/item_excluido_com_sucesso/$',
- direct_to_template, {'template': 'wiki_item_successfully_deleted.html'}),
- (r'^wiki/novo_item/$', 'apps.wiki.views.add_wiki_item'),
- (r'^wiki/novo_item/adicionado_com_sucesso/$',
- direct_to_template, {'template': 'wiki_item_successfully_added.html'}),
+ (r'^wiki/', include('apps.wiki.urls')),
(r'^site_media/(.*)$', 'django.views.static.serve', {"document_root": settings.MEDIA_ROOT}),
)

0 comments on commit 203379d

Please sign in to comment.