# Path: gitcms/conferences/models.py
# class Conference(models.Model):
#     name = models.CharField(u'Name', max_length=255)
#     short_name = models.CharField(u'Short Name', max_length=255)
#     location = models.CharField(u'Location', max_length=255)
#     start = models.DateField(u'Start')
#     end = models.DateField(u'End')
#     submission_deadline = models.DateField(u'Submission Deadline', blank=True, null=True)
#     url = models.URLField(u'URL', blank=True, null=True)
#     comment = models.TextField(u'Comment')
#     def __unicode__(self):
#         return self.name
# 
#     def summary(self):
#         return '%s (%s)' % (self.name, self.short_name)


from .models import Conference
from django.shortcuts import get_object_or_404, render_to_response
from django.http import HttpResponse
import datetime
        import vobject
    return render_to_response(
                'conferences/list.html',
                {
                    'conferences' : conferences,
                })

def upcoming_submissions(request):
    conferences = Conference.objects.filter(submission_deadline__gte=datetime.datetime.now()).order_by('submission_deadline')
    return render_to_response(
                'conferences/list.html',
                {
                    'conferences' : conferences,
                })

def upcomingical(request):
    '''
    upcomingical(request)

    Returns the calendar of conferences as an ical file.
    '''
    try:
    except ImportError:
        return HttpResponse('import vobject failed in confereces/views.py:upcomingical')
    def _add_event(summary, start, end=None):
        if end is None:
            end = start
        rep = cal.add('vevent')
        rep.add('summary').value = summary
        rep.add('dtstart').value = start
        rep.add('dtend').value = end

# Path: gitcms/conferences/models.py
# class Conference(models.Model):
#     name = models.CharField(u'Name', max_length=255)
#     short_name = models.CharField(u'Short Name', max_length=255)
#     location = models.CharField(u'Location', max_length=255)
#     start = models.DateField(u'Start')
#     end = models.DateField(u'End')
#     submission_deadline = models.DateField(u'Submission Deadline', blank=True, null=True)
#     url = models.URLField(u'URL', blank=True, null=True)
#     comment = models.TextField(u'Comment')
#     def __unicode__(self):
#         return self.name
# 
#     def summary(self):
#         return '%s (%s)' % (self.name, self.short_name)


# Path: gitcms/conferences/views.py
from .models import Conference
from django.shortcuts import get_object_or_404, render_to_response
from django.http import HttpResponse
import datetime
        import vobject

    return render_to_response(
                'conferences/list.html',
                {
                    'conferences' : conferences,
                })

def upcoming_submissions(request):
    conferences = Conference.objects.filter(submission_deadline__gte=datetime.datetime.now()).order_by('submission_deadline')
    return render_to_response(
                'conferences/list.html',
                {
                    'conferences' : conferences,
                })

def upcomingical(request):
    '''
    upcomingical(request)

    Returns the calendar of conferences as an ical file.
    '''
    try:
    except ImportError:
        return HttpResponse('import vobject failed in confereces/views.py:upcomingical')
    def _add_event(summary, start, end=None):
        if end is None:
            end = start
        rep = cal.add('vevent')
        rep.add('summary').value = summary
        rep.add('dtstart').value = start
        rep.add('dtend').value = end

    events = Conference.objects.filter(start__gte=datetime.datetime.now()).order_by('start')