示例#1
0
    def handle(self, *args, **options):
        print("# Families:")
        for o in Family.objects.all():
            print("\t".join([o.slug, '%d' % o.language_set.count()]))
        print("\n")

        print("# Languages:")
        for o in Language.objects.all():
            try:
                fam = o.family.all()[0].slug
            except IndexError:
                fam = "-"
            print("\t".join([o.slug, fam, '%d' % o.lexicon_set.count()]))
        print("\n")

        print("# Sources:")
        for o in Source.objects.all():
            print("\t".join([o.slug, '%d' % o.lexicon_set.count()]))
        print("\n")

        print("# Words:")
        for o in Word.objects.all():
            print("\t".join([o.slug, '%d' % o.lexicon_set.count()]))
        print("\n")

        print("# Statistics:")
        s = statistic.update(save=False)
        for label, value in s.items():
            print("*%s\t%d" % (label, value))
示例#2
0
 def handle(self, *args, **options):
     print("# Families:")
     for o in Family.objects.all():
         print("\t".join([o.slug, '%d' % o.language_set.count()]))
     print("\n")
     
     print("# Languages:")
     for o in Language.objects.all():
         try:
             fam = o.family.all()[0].slug
         except IndexError:
             fam = "-"
         print("\t".join([o.slug, fam, '%d' % o.lexicon_set.count()]))
     print("\n")
     
     print("# Sources:")
     for o in Source.objects.all():
         print("\t".join([o.slug, '%d' % o.lexicon_set.count()]))
     print("\n")
     
     print("# Words:")
     for o in Word.objects.all():
         print("\t".join([o.slug, '%d' % o.lexicon_set.count()]))
     print("\n")
     
     print("# Statistics:")
     s = statistic.update(save=False)
     for label, value in s.items():
         print("*%s\t%d" % (label, value))
 def handle(self, *args, **options):
     statistic.update(save=True)
     for v in StatisticalValue.objects.all().order_by('-date'):
         date = v.date.isoformat().split("T")[0]
         print("\t".join([v.label, date, '%d' % v.value]))
 def handle(self, *args, **options):
     s = statistic.update(save=False)
     for label, value in s.items():
         print(u"%s %s" % (label.ljust(30), value))
 def handle(self, *args, **options):
     statistic.update()