I have created custom events plugin and now I want to display closest event on my home page (django-cms page with home.html template). How can I do it? This is my event/models.py
from django.core.urlresolvers import reverse
from django.db import models
from adminsortable.models import Sortable
from easy_thumbnails.fields import ThumbnailerImageField
from cms.models.fields import PlaceholderField
from cms.models.pluginmodel import CMSPlugin
class Event(Sortable):
class Meta:
app_label = 'event'
event_name = models.CharField(
blank=False,
default='',
max_length=64,
)
date = models.DateField(
auto_now=False,
auto_now_add=False,
)
photo = ThumbnailerImageField(
upload_to='events',
blank=True,
)
def __unicode__(self):
return self.event_name