# Path: competition/models.py
# class Competition(models.Model):
#     name = models.CharField('Name', max_length=255, unique=True)
#     slug = models.SlugField(unique=True)
#     url = models.URLField('Competition URL', blank=True)
#     start_time = models.DateTimeField(blank=True, null=True)
#     end_time = models.DateTimeField(blank=True, null=True)
# 
#     def __unicode__(self):
#         return self.name
# 
#     __str__ = __unicode__
# 
#     def get_absolute_url(self):
#         return reverse('view_ctf', kwargs={'ctf_slug': self.slug})


from competition.models import Competition


def ctf_sidebar(request):
    context = {
        'sidebar': {

# Path: competition/models.py
# class Competition(models.Model):
#     name = models.CharField('Name', max_length=255, unique=True)
#     slug = models.SlugField(unique=True)
#     url = models.URLField('Competition URL', blank=True)
#     start_time = models.DateTimeField(blank=True, null=True)
#     end_time = models.DateTimeField(blank=True, null=True)
# 
#     def __unicode__(self):
#         return self.name
# 
#     __str__ = __unicode__
# 
#     def get_absolute_url(self):
#         return reverse('view_ctf', kwargs={'ctf_slug': self.slug})


# Path: collabCTF/context_processors.py
from competition.models import Competition



def ctf_sidebar(request):
    context = {
        'sidebar': {

            'ctfs': Competition.objects.only('name', 'slug')