Created
April 24, 2012 13:39
-
-
Save gcavalcante8808/2479745 to your computer and use it in GitHub Desktop.
Exemplo Views.py --> Urls Amigáveis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf.urls.defaults import * | |
urlpatterns = patterns ('', | |
(r'^divulgacao/(?P<slug_categoria>[\w_-]+)/(?P<slug_divulgacao>[\w_-]+)/$', 'CAMINHOPARAAVIEW'), | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def news_page(request, slug_categoria, slug_divulgacao): | |
news = get_object_or_404(Noticia, categoria__slugcategoria=slug_categoria, slugdivulgacao=slug_divulgacao) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment