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.db import models | |
from django.utils.translation import ugettext_lazy as _ | |
from django.contrib.auth import get_user_model | |
from django.contrib.auth.models import Group | |
from mptt.models import MPTTModel, TreeForeignKey | |
#TODO: Handle the change agains current revision. At this moment, the change is manual. | |
class Article(MPTTModel): | |
""" |
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
{% extends "index.html" %} | |
{% load mptt_tags %} | |
{% load i18n %} | |
{% block wiki_breadcrumbs %} | |
{% recursetree nodes %} | |
{% if node.get_ancestors %} | |
{% for item in node.get_ancestors %} | |
<a href="{% url 'get' item.id %}">{{ item }}</a> | |
<span class="divider">/</span> |
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
class ArticleView(ListView): | |
model = Article | |
template_name = 'wiki/view.html' | |
def get_queryset(self, article_id=None): | |
article_id = self.kwargs.get("article_id") | |
self.queryset = Article.objects.filter(id=article_id) | |
return self.queryset | |
def get_context_data(self, **kwargs): |
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
Environment: | |
Request Method: POST | |
Request URL: http://localhost:8000/admin/core/domaincredential/add/ | |
Django Version: 1.4b1 | |
Python Version: 2.7.2 | |
Installed Applications: | |
('django.contrib.auth', |
NewerOlder