# Path: standup/status/models.py
# class Project(models.Model):
#     """A project that does standups."""
# 
#     name = models.CharField(max_length=100, unique=True)
#     slug = models.CharField(max_length=100, unique=True)
#     color = models.CharField(max_length=6)
#     repo_url = models.URLField(max_length=100)
# 
#     class Meta:
#         db_table = 'project'
#         ordering = ('name',)
# 
#     def __str__(self):
#         return self.name
# 
#     def __repr__(self):
#         return '<Project: [%s] %s>' % (self.slug, self.name)
# 
#     def get_absolute_url(self):
#         try:
#             return reverse('status.project', kwargs={'slug': self.slug})
#         except NoReverseMatch:
#             return ''
# 
#     def dictify(self):
#         """Returns an OrderedDict of model attributes"""
#         data = OrderedDict()
#         data['id'] = self.id
#         data['name'] = self.name
#         data['slug'] = self.slug
#         data['color'] = self.color
#         return data
# 
# class Team(models.Model):
#     """A team of users in the organization."""
#     name = models.CharField(
#         max_length=100,
#         help_text='Name of the team'
#     )
#     slug = models.SlugField(unique=True, max_length=100)
#     users = models.ManyToManyField(StandupUser, related_name='teams')
# 
#     class Meta:
#         db_table = 'team'
#         ordering = ('name',)
# 
#     def __str__(self):
#         return self.name
# 
#     def __repr__(self):
#         return '<Team: [%s]>' % (self.name,)
# 
#     def get_absolute_url(self):
#         try:
#             return reverse('status.team', kwargs={'slug': self.slug})
#         except NoReverseMatch:
#             return ''
# 
#     def statuses(self):
#         user_ids = self.users.values_list('id', flat=True)
#         return Status.objects.filter(user__pk__in=user_ids)
# 
#     def dictify(self):
#         data = OrderedDict()
#         data['id'] = self.id
#         data['name'] = self.name
#         data['slug'] = self.slug
#         return data
# 
# class SiteMessage(models.Model):
#     """Messages shown on all pages on the site"""
#     message = models.TextField(
#         help_text='Site message'
#     )
#     enabled = models.BooleanField(
#         default=True,
#         help_text='Whether or not this message is enabled'
#     )
#     created = models.DateTimeField(
#         default=timezone.now,
#         help_text='When this message was created'
#     )


from django.conf import settings
from .models import Project, Team, SiteMessage
from .utils import get_weeks, get_today, get_yesterday



def status(request):
    return {
        'request': request,
        'settings': settings,
        'teams': Team.objects.all(),
        'projects': Project.objects.all(),
        'weeks': get_weeks(),
        'today': get_today(),

# Path: standup/status/models.py
# class Project(models.Model):
#     """A project that does standups."""
# 
#     name = models.CharField(max_length=100, unique=True)
#     slug = models.CharField(max_length=100, unique=True)
#     color = models.CharField(max_length=6)
#     repo_url = models.URLField(max_length=100)
# 
#     class Meta:
#         db_table = 'project'
#         ordering = ('name',)
# 
#     def __str__(self):
#         return self.name
# 
#     def __repr__(self):
#         return '<Project: [%s] %s>' % (self.slug, self.name)
# 
#     def get_absolute_url(self):
#         try:
#             return reverse('status.project', kwargs={'slug': self.slug})
#         except NoReverseMatch:
#             return ''
# 
#     def dictify(self):
#         """Returns an OrderedDict of model attributes"""
#         data = OrderedDict()
#         data['id'] = self.id
#         data['name'] = self.name
#         data['slug'] = self.slug
#         data['color'] = self.color
#         return data
# 
# class Team(models.Model):
#     """A team of users in the organization."""
#     name = models.CharField(
#         max_length=100,
#         help_text='Name of the team'
#     )
#     slug = models.SlugField(unique=True, max_length=100)
#     users = models.ManyToManyField(StandupUser, related_name='teams')
# 
#     class Meta:
#         db_table = 'team'
#         ordering = ('name',)
# 
#     def __str__(self):
#         return self.name
# 
#     def __repr__(self):
#         return '<Team: [%s]>' % (self.name,)
# 
#     def get_absolute_url(self):
#         try:
#             return reverse('status.team', kwargs={'slug': self.slug})
#         except NoReverseMatch:
#             return ''
# 
#     def statuses(self):
#         user_ids = self.users.values_list('id', flat=True)
#         return Status.objects.filter(user__pk__in=user_ids)
# 
#     def dictify(self):
#         data = OrderedDict()
#         data['id'] = self.id
#         data['name'] = self.name
#         data['slug'] = self.slug
#         return data
# 
# class SiteMessage(models.Model):
#     """Messages shown on all pages on the site"""
#     message = models.TextField(
#         help_text='Site message'
#     )
#     enabled = models.BooleanField(
#         default=True,
#         help_text='Whether or not this message is enabled'
#     )
#     created = models.DateTimeField(
#         default=timezone.now,
#         help_text='When this message was created'
#     )


# Path: standup/status/context_processors.py
from django.conf import settings
from .models import Project, Team, SiteMessage
from .utils import get_weeks, get_today, get_yesterday




def status(request):
    return {
        'request': request,
        'settings': settings,
        'teams': Team.objects.all(),
        'projects': Project.objects.all(),
        'weeks': get_weeks(),
        'today': get_today(),

        'yesterday': get_yesterday(),