This file contains hidden or 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
Quando eu entro na notícia com o link, dá certo. | |
http://localhost:8000/categoria/teste-de-slug | |
Quando eu coloco '#' no link, a notícia é exibida normalmente. | |
Caught NoReverseMatch while rendering: Reverse for 'Scope.views.noticiainterna' with arguments '()' and keyword arguments '{'slugnoticia': u'teste-de-slug'}' not found. | |
Estou achando que o erro está no models na hora de gerar a url na def get_absolute_url. |
This file contains hidden or 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
<div id="paginac"> | |
<div id="botoes"> | |
{% if notipage.has_previous %} | |
<a href="?page={{ notipage.previous_page_number }}"> | |
<div id="botnBack"></div> | |
</a> | |
{% endif %} | |
{% if notipage.has_next %} | |
<a href="?page={{ notipage.next_page_number }}"> | |
<div id="botnLeft"></div> |
This file contains hidden or 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
{{ c.cargo }} |
This file contains hidden or 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 Categoria(models.Model): | |
nome = models.CharField(max_length=30) | |
slugcategoria = models.SlugField(max_length=100, blank=True, unique=True) | |
class Noticia(BaseNoticia): | |
titulo = models.CharField(max_length=100, unique=True) | |
slugnoticia = models.SlugField(max_length=200, blank=True, unique=True) | |
def noticia_pre_save(signal, instance, sender, **kwargs): | |
if instance.nomeCategoria.id == '1': |
This file contains hidden or 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 Video(BaseNoticia): | |
destaque = models.BooleanField(default=False) | |
url = models.CharField(max_length=15, help_text="fhbTBA64FkU") |
This file contains hidden or 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 ManifestacoesForm(forms.ModelForm): | |
class Meta: | |
model = Manifestacoes | |
exclude = ['codigo', 'ano', 'transferido', 'arquivado', 'ala', 'estante', 'prateleira', 'caixa', 'cancelamento', 'motivo_cancelamento'] | |
def __init__(self, *args, **kwargs): | |
super(ManifestacoesForm, self).__init__(*args, **kwargs) | |
self.fields.keyOrder = ['name', 'summary', 'description'] |
This file contains hidden or 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
<form method="POST"> | |
{% csrf_token %} | |
<p><label>Deseja se identificar?</label>{{ form.anonimo }}</p> | |
<div class="control-group"> | |
<p><label>Nome</label>{{ formP.nome }}</p> | |
<p><label>CPF</label>{{ formP.cpf }}</p> | |
<p><label>RG</label>{{ formP.rg }}</p> | |
<p><label>Telefone</label>{{ formP.telefone }}</p> | |
</div> | |
<p><label>Qual é o tipo da sua manifestação?</label>{{ form.objeto }}</p> |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
from datetime import datetime | |
from django.contrib.auth.models import User | |
from django.db import models | |
from geral.models import Pessoas, BasePessoas, Unidades, Orgaos, Logradouros | |
OPERACAO = (('1', 'Despacho'),('2', 'Transferência'),('3', 'Parecer')) | |
SETOR_CHOICES = (('P', 'Processo'),('O', 'ouvidoria')) | |
class Advogados(BasePessoas, Logradouros): | |
oab = models.CharField('OAB', max_length=10, blank=True, null=True) |
This file contains hidden or 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 datetime import * | |
hoje = date.today() | |
data_limite = hoje + timedelta(days=60) | |
print hoje | |
print data_limite |
This file contains hidden or 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
import os | |
import sys | |
import site | |
# Calculates the path based on location of WSGI script. | |
apache_configuration = os.path.realpath(os.path.dirname(__file__)) | |
project = os.path.join(apache_configuration, 'nomedoproto') | |
sys.path.append(apache_configuration) | |
sys.path.append(project) |
OlderNewer