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 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
{{ 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
<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
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. |
NewerOlder