Hello,
I created a Homepage that is powered by the admin, the content of the
homepage should be Images stacked on each other, after creating my model
and index.html template, nothing seems to be coming up even though the
block tags are included in base.html. Some help here please
here's what my model looks like:
#model.py :
class HomePage(Page, RichText):
'''
A page representing the format of the home page
'''
class Meta:
verbose_name = _("Home page")
verbose_name_plural = _("Home pages")
class Gallery(models.Model):
homepage = models.ForeignKey("HomePage", blank =True, null=True)
image = FileField(verbose_name=_("Image"),
upload_to=upload_to("theme.Gallery.image", "gallery")
)
def __unicode__(self):
return self.image.name
and my index.html :
{% extends "pages/page.html" %}
{% load mezzanine_tags staticfiles %}
{% block all_content %}
{% if page.homepage.Gallerys.all %}
{% for gallery in page.homepage.Gallerys.all %}
<img src="{{ MEDIA_URL }}{% thumbnail gallery.image 1920 690 %}">
{% endfor %}
{% endif %}
{% endblock %}
--
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.