# Path: pendulum/utils.py
# def determine_period(the_date=date.today(), delta=0):
# def parse_time(time_str, input_formats=None):
# def get_total_time(seconds):
# DEFAULT_TIME_FORMATS = [
#     '%H:%M',        # 23:15         => 23:15:00
#     '%H:%M:%S',     # 05:50:21      => 05:50:21
#     '%I:%M:%S %p',  # 11:40:53 PM   => 23:40:53
#     '%I:%M %p',     # 6:21 AM       => 06:21:00
#     '%I %p',        # 1 pm          => 13:00:00
#     '%I:%M:%S%p',   # 8:45:52pm     => 23:45:52
#     '%I:%M%p',      # 12:03am       => 00:03:00
#     '%I%p',         # 12pm          => 12:00:00
#     '%H',           # 22            => 22:00:00
# ]


from django.db import models
from django.contrib.sites.models import Site
from django.contrib.auth.models import User
from datetime import datetime, date, timedelta
from pendulum import utils
            import hashlib
            import sha
        return self.name

    def __log_count(self):
        """
        Determine the number of entries associated with this activity
        """
        return self.entries.all().count()
    log_count = property(__log_count)

    def __total_hours(self):
        """
        Determine the number of hours spent doing each type of activity
        """
        times = [e.total_hours for e in self.entries.all()]
        return '%.02f' % sum(times)
    total_hours = property(__total_hours)

    class Meta:
        ordering = ['name']
        verbose_name_plural = 'activities'

class EntryManager(models.Manager):
    #def get_query_set(self):
    #    return super(EntryManager, self).get_query_set().filter(site__exact=CURRENT_SITE)

    def current(self, user=None):
        """
        This will pull back any log entries for the current period.
        """
        try:

# Path: pendulum/utils.py
# def determine_period(the_date=date.today(), delta=0):
# def parse_time(time_str, input_formats=None):
# def get_total_time(seconds):
# DEFAULT_TIME_FORMATS = [
#     '%H:%M',        # 23:15         => 23:15:00
#     '%H:%M:%S',     # 05:50:21      => 05:50:21
#     '%I:%M:%S %p',  # 11:40:53 PM   => 23:40:53
#     '%I:%M %p',     # 6:21 AM       => 06:21:00
#     '%I %p',        # 1 pm          => 13:00:00
#     '%I:%M:%S%p',   # 8:45:52pm     => 23:45:52
#     '%I:%M%p',      # 12:03am       => 00:03:00
#     '%I%p',         # 12pm          => 12:00:00
#     '%H',           # 22            => 22:00:00
# ]


# Path: pendulum/models.py
from django.db import models
from django.contrib.sites.models import Site
from django.contrib.auth.models import User
from datetime import datetime, date, timedelta
from pendulum import utils
            import hashlib
            import sha

        return self.name

    def __log_count(self):
        """
        Determine the number of entries associated with this activity
        """
        return self.entries.all().count()
    log_count = property(__log_count)

    def __total_hours(self):
        """
        Determine the number of hours spent doing each type of activity
        """
        times = [e.total_hours for e in self.entries.all()]
        return '%.02f' % sum(times)
    total_hours = property(__total_hours)

    class Meta:
        ordering = ['name']
        verbose_name_plural = 'activities'

class EntryManager(models.Manager):
    #def get_query_set(self):
    #    return super(EntryManager, self).get_query_set().filter(site__exact=CURRENT_SITE)

    def current(self, user=None):
        """
        This will pull back any log entries for the current period.
        """
        try:

            set = self.in_period(utils.determine_period())