# Path: apps/subscribers/models.py
# class Count(models.Model):
#     active = models.IntegerField()
#     total = models.IntegerField()
#     timestamp = models.DateTimeField(default=timezone.now)
# 
#     # Custom manager.
#     objects = CountManager()
# 
#     class Meta:
#         get_latest_by = 'timestamp'
#         ordering = ['timestamp']
# 
#     def __str__(self):
#         return '{}/{} on {}'.format(self.active, self.total, self.timestamp)


from django.core.management.base import NoArgsCommand
from apps.subscribers.models import Count
# -*- coding: utf-8 -*-



class Command(NoArgsCommand):
    help = 'Counts and saves the total number of subscriptions for the current day.'

    def handle_noargs(self, **options):

# Path: apps/subscribers/models.py
# class Count(models.Model):
#     active = models.IntegerField()
#     total = models.IntegerField()
#     timestamp = models.DateTimeField(default=timezone.now)
# 
#     # Custom manager.
#     objects = CountManager()
# 
#     class Meta:
#         get_latest_by = 'timestamp'
#         ordering = ['timestamp']
# 
#     def __str__(self):
#         return '{}/{} on {}'.format(self.active, self.total, self.timestamp)


# Path: apps/subscribers/management/commands/updatecounts.py
from django.core.management.base import NoArgsCommand
from apps.subscribers.models import Count

# -*- coding: utf-8 -*-



class Command(NoArgsCommand):
    help = 'Counts and saves the total number of subscriptions for the current day.'

    def handle_noargs(self, **options):

        count = Count.objects.create_count()