django计数器: form collections import Counter

counts = Counter(
                app_config.name for app_config in self.app_configs.values())

Counter({'django_celery_beat': 1, 'django.contrib.sessions': 1, 'corsheaders': 1, 'apps.vanilla': 1, 'django.contrib.messages': 1, 'apps.user': 1, 
'apps.cmdbmgr': 1, 'apps.common': 1, 'apps.flowmgr': 1, 'django.contrib.admin': 1, 'django.contrib.contenttypes': 1, 'django.contrib.staticfiles': 1,
'django_celery_results': 1, 'django.contrib.auth': 1})

  

猜你喜欢

转载自www.cnblogs.com/Fmaj7/p/13163734.html