class Meta:
verbose_name = _("image")
verbose_name_plural = _("images")
+ order_with_respect_to = "event"
class EventDepartment(models.Model):
@register.filter
def get_type(objects, type):
- objs = objects.filter(type=type)
+ if isinstance(objects, list):
+ objs = []
+ for object in objects:
+ if obj.type == type:
+ objs.append(obj)
+ else:
+ objs = objects.filter(type=type)
if objs:
return objs
return None
<a class="article-box" href="{{ content.content_object.get_absolute_url }}" title="{{ content.content_object.title }}">
<div class="article-box__header">
<figure class="article-box__image">
- {% with content.content_object.images.all|get_type:'card' as image %}
- {% if image %}
- <img src="{{ MEDIA_URL }}{% thumbnail image.first.file 427 286 %}" data-src="{{ MEDIA_URL }}{% thumbnail images.0.file 427 286 %}" class="lazyload" alt="" />
+ {% with content.content_object.images.all|get_type:'card' as images %}
+ {% if images %}
+ <img src="{{ MEDIA_URL }}{% thumbnail images.first.file 427 286 %}" data-src="{{ MEDIA_URL }}{% thumbnail images.0.file 427 286 %}" class="lazyload" alt="" />
{% endif %}
{% endwith %}
</figure>
{% extends "base.html" %}
-{% load i18n pages_tags mezzanine_tags %}
+{% load i18n pages_tags mezzanine_tags %}
{% block meta_title %}
{% trans "Home" %}