Sorry for not giving much detail,
The object is being passed to direct_to_template view method:
extra_context = {"menssagens": Menssagem.objects.filter(publicado=True)}
url("^$", direct_to_template, {"template": "index.html", "extra_context":
extra_context}, name="home"),
I have also tried creating a custom view.
And this is my models.py
class Menssagem(models.Model):
menssagem = models.TextField()
publicado = models.BooleanField(default=False)
class Meta:
verbose_name = "Menssagem"
verbose_name_plural = "Menssagens"
Em segunda-feira, 28 de março de 2016 19:12:28 UTC-3, Bernardo Tavares
escreveu:
>
> Hello guys,
> I'm pulling my hair out trying to solve this issue and couldn't find any
> solution on the internet or docs.
>
> I have the following code in my template:
>
> {% nevercache %}
> {% if menssagens %}
> {% for menssagem in menssagens %}
> <div class="alert alert-danger fade in">
> {{ menssagem.menssagem }}
> <a href="#" class="close" data-dismiss="alert" aria-label="close">&
> times;</a>
> </div>
> {% endfor %}
> {% endif %}
> {% endnevercache %}
>
> The problem is when i change a database entry the changes are not rendered
> to the html. I have to restart the server to update the changes. I thought
> the problem was with mezzanine's caching engine. I have tried using
> mezzanine.conf.Settings clear_cache() method and changing
> CACHE_SET_DELAY_SECONDS without success.
>
> How can I update my html in real time like a page or blog entry?
>
> Any help would be greatly appreciated!
>
--
You received this message because you are subscribed to the Google Groups
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.