# Path: symposion/conference/models.py
# class Conference(models.Model):
#     """
#     the full conference for a specific year, e.g. US PyCon 2012.
#     """
#     
#     title = models.CharField(_("title"), max_length=100)
#     
#     # when the conference runs
#     start_date = models.DateField(_("start date"), null=True, blank=True)
#     end_date = models.DateField(_("end date"), null=True, blank=True)
#     
#     # timezone the conference is in
#     timezone = TimeZoneField(_("timezone"), blank=True)
#     
#     def __unicode__(self):
#         return self.title
#     
#     def save(self, *args, **kwargs):
#         super(Conference, self).save(*args, **kwargs)
#         if self.id in CONFERENCE_CACHE:
#             del CONFERENCE_CACHE[self.id]
#     
#     def delete(self):
#         pk = self.pk
#         super(Conference, self).delete()
#         try:
#             del CONFERENCE_CACHE[pk]
#         except KeyError:
#             pass
#     
#     class Meta(object):
#         verbose_name = _("conference")
#         verbose_name_plural = _("conferences")


import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
from symposion.conference.models import Conference
    conference = models.ForeignKey(Conference, verbose_name=_("conference"))
    name = models.CharField(_("name"), max_length=100)
    order = models.IntegerField(_("order"), default=0)
    description = models.TextField(_("description"), blank=True)
    
    class Meta:
        ordering = ["conference", "order"]
        verbose_name = _("sponsor level")
        verbose_name_plural = _("sponsor levels")
    
    def __unicode__(self):
        return u"%s %s" % (self.conference, self.name)
    
    def sponsors(self):
        return self.sponsor_set.filter(active=True).order_by("added")


class Sponsor(models.Model):
    
    name = models.CharField(_("name"), max_length=100)
    external_url = models.URLField(_("external URL"))
    annotation = models.TextField(_("annotation"), blank=True)
    contact_name = models.CharField(_("contact_name"), max_length=100)
    contact_email = models.EmailField(_(u"Contact e\u2011mail"))
    logo = models.ImageField(_("logo"), upload_to="sponsor_logos/")
    level = models.ForeignKey(SponsorLevel, verbose_name=_("level"))
    added = models.DateTimeField(_("added"), default=datetime.datetime.now)
    active = models.BooleanField(_("active"), default=False)
    
    def __unicode__(self):

# Path: symposion/conference/models.py
# class Conference(models.Model):
#     """
#     the full conference for a specific year, e.g. US PyCon 2012.
#     """
#     
#     title = models.CharField(_("title"), max_length=100)
#     
#     # when the conference runs
#     start_date = models.DateField(_("start date"), null=True, blank=True)
#     end_date = models.DateField(_("end date"), null=True, blank=True)
#     
#     # timezone the conference is in
#     timezone = TimeZoneField(_("timezone"), blank=True)
#     
#     def __unicode__(self):
#         return self.title
#     
#     def save(self, *args, **kwargs):
#         super(Conference, self).save(*args, **kwargs)
#         if self.id in CONFERENCE_CACHE:
#             del CONFERENCE_CACHE[self.id]
#     
#     def delete(self):
#         pk = self.pk
#         super(Conference, self).delete()
#         try:
#             del CONFERENCE_CACHE[pk]
#         except KeyError:
#             pass
#     
#     class Meta(object):
#         verbose_name = _("conference")
#         verbose_name_plural = _("conferences")


# Path: symposion/sponsorship/models.py
import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
from symposion.conference.models import Conference

    conference = models.ForeignKey(Conference, verbose_name=_("conference"))
    name = models.CharField(_("name"), max_length=100)
    order = models.IntegerField(_("order"), default=0)
    description = models.TextField(_("description"), blank=True)
    
    class Meta:
        ordering = ["conference", "order"]
        verbose_name = _("sponsor level")
        verbose_name_plural = _("sponsor levels")
    
    def __unicode__(self):
        return u"%s %s" % (self.conference, self.name)
    
    def sponsors(self):
        return self.sponsor_set.filter(active=True).order_by("added")


class Sponsor(models.Model):
    
    name = models.CharField(_("name"), max_length=100)
    external_url = models.URLField(_("external URL"))
    annotation = models.TextField(_("annotation"), blank=True)
    contact_name = models.CharField(_("contact_name"), max_length=100)
    contact_email = models.EmailField(_(u"Contact e\u2011mail"))
    logo = models.ImageField(_("logo"), upload_to="sponsor_logos/")
    level = models.ForeignKey(SponsorLevel, verbose_name=_("level"))
    added = models.DateTimeField(_("added"), default=datetime.datetime.now)
    active = models.BooleanField(_("active"), default=False)
    
    def __unicode__(self):

        return self.name