Update make_stats script

This commit is contained in:
Mikaël Ates 2012-03-21 18:06:13 +01:00
parent e2babc7570
commit 787ea58d8d
1 changed files with 8 additions and 24 deletions

View File

@ -29,7 +29,12 @@ from django.contrib.auth.models import User
from acs import settings
from acs.models import *
from acs.abac.models import *
from acs.attribute_aggregator.models import *
try:
import ldap
except ImportError:
ldap = None
class Command(BaseCommand):
@ -92,31 +97,10 @@ class Command(BaseCommand):
n_Namespace = len(Namespace.objects.all())
n_Policy = len(Policy.objects.all())
n_Source = len(Source.objects.all())
n_LdapSource = len(LdapSource.objects.all())
n_AttributeDefinition = len(AttributeDefinition.objects.all())
n_AttributeNamespace = len(AttributeNamespace.objects.all())
n_AttributeMapInNamespace = len(AttributeMapInNamespace.objects.all())
n_AttributeName = len(AttributeName.objects.all())
n_AttributeData = len(AttributeData.objects.all())
n_StringM = len(StringM.objects.all())
n_BooleanM = len(BooleanM.objects.all())
n_IntegerM = len(IntegerM.objects.all())
n_DoubleM = len(DoubleM.objects.all())
n_TimeM = len(TimeM.objects.all())
n_DateM = len(DateM.objects.all())
n_DateTimeM = len(DateTimeM.objects.all())
n_Rfc822NameM = len(Rfc822NameM.objects.all())
n_IpAddressM = len(IpAddressM.objects.all())
n_AssertionAny = len(AssertionAny.objects.all())
n_AssertionDefinition = len(AssertionDefinition.objects.all())
n_AttachedSource = len(AttachedSource.objects.all())
n_AssertionData = len(AssertionData.objects.all())
n_AttributeSource = len(AttributeSource.objects.all())
if ldap:
n_LdapSource = len(LdapSource.objects.all())
n_UserAttributeProfile = len(UserAttributeProfile.objects.all())
n_Predicate = len(Predicate.objects.all())
n_PredicateRequired = len(PredicateRequired.objects.all())
n_PredicateRole = len(PredicateRole.objects.all())
n_PredicateComparison = len(PredicateComparison.objects.all())
n_AbacRule = len(AbacRule.objects.all())
print 'Current statistics:'