# Path: symposion/conference/models.py
# class Section(models.Model):
#     """
#     a section of the conference such as "Tutorials", "Workshops",
#     "Talks", "Expo", "Sprints", that may have its own review and
#     scheduling process.
#     """
#     
#     conference = models.ForeignKey(Conference, verbose_name=_("conference"))
#     
#     name = models.CharField(_("name"), max_length=100)
#     slug = models.SlugField()
# 
#     # when the section runs
#     start_date = models.DateField(_("start date"), null=True, blank=True)
#     end_date = models.DateField(_("end date"), null=True, blank=True)
#     
#     def __unicode__(self):
#         return "%s %s" % (self.conference, self.name)
#     
#     class Meta(object):
#         verbose_name = _("section")
#         verbose_name_plural = _("sections")


import datetime
import os
import uuid
import reversion
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from markitup.fields import MarkupField
from model_utils.managers import InheritanceManager
from symposion.conference.models import Section
    def available(cls):
        now = datetime.datetime.now()
        return cls._default_manager.filter(
            Q(start__lt=now) | Q(start=None),
            Q(end__gt=now) | Q(end=None),
            Q(closed=False) | Q(closed=None),
        )
    
    def is_available(self):
        if self.closed:
            return False
        now = datetime.datetime.now()
        if self.start and self.start > now:
            return False
        if self.end and self.end < now:
            return False
        return True
    
    def __unicode__(self):
        return self.section.name


class ProposalKind(models.Model):
    """
    e.g. talk vs panel vs tutorial vs poster
    
    Note that if you have different deadlines, reviewers, etc. you'll want
    to distinguish the section as well as the kind.
    """
    

# Path: symposion/conference/models.py
# class Section(models.Model):
#     """
#     a section of the conference such as "Tutorials", "Workshops",
#     "Talks", "Expo", "Sprints", that may have its own review and
#     scheduling process.
#     """
#     
#     conference = models.ForeignKey(Conference, verbose_name=_("conference"))
#     
#     name = models.CharField(_("name"), max_length=100)
#     slug = models.SlugField()
# 
#     # when the section runs
#     start_date = models.DateField(_("start date"), null=True, blank=True)
#     end_date = models.DateField(_("end date"), null=True, blank=True)
#     
#     def __unicode__(self):
#         return "%s %s" % (self.conference, self.name)
#     
#     class Meta(object):
#         verbose_name = _("section")
#         verbose_name_plural = _("sections")


# Path: symposion/proposals/models.py
import datetime
import os
import uuid
import reversion
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from markitup.fields import MarkupField
from model_utils.managers import InheritanceManager
from symposion.conference.models import Section

    def available(cls):
        now = datetime.datetime.now()
        return cls._default_manager.filter(
            Q(start__lt=now) | Q(start=None),
            Q(end__gt=now) | Q(end=None),
            Q(closed=False) | Q(closed=None),
        )
    
    def is_available(self):
        if self.closed:
            return False
        now = datetime.datetime.now()
        if self.start and self.start > now:
            return False
        if self.end and self.end < now:
            return False
        return True
    
    def __unicode__(self):
        return self.section.name


class ProposalKind(models.Model):
    """
    e.g. talk vs panel vs tutorial vs poster
    
    Note that if you have different deadlines, reviewers, etc. you'll want
    to distinguish the section as well as the kind.
    """
    

    section = models.ForeignKey(Section, related_name="proposal_kinds")