示例#1
0
 def __init__(self, *args, **kwargs):
     _AuthorForm.__init__(self, *args, **kwargs)
     ## Add a note to the 'role' help text indicating how many admins
     ## are permitted with this kind of account.
     tier_info = TierInfo.objects.get_current()
     tier = tier_info.get_tier()
     if tier.admins_limit() is not None:
         message = 'With a %s, you may have %d administrator%s.' % (
             tier_info.get_tier_name_display(),
             tier.admins_limit(),
             defaultfilters.pluralize(tier.admins_limit()))
         self.fields['role'].help_text = message
示例#2
0
 def __init__(self, *args, **kwargs):
     _AuthorForm.__init__(self, *args, **kwargs)
     ## Add a note to the 'role' help text indicating how many admins
     ## are permitted with this kind of account.
     self.tier = SiteTierInfo.objects.get_current().tier
     if self.tier.admin_limit is not None:
         # For backwards-compatibility, pretend the site owner (a
         # superuser) counts toward the limit.
         limit = self.tier.admin_limit + 1
         message = ('With a {tier_name}, you may have {limit} '
                    'administrator{s}.').format(tier_name=self.tier.name,
                                                limit=limit,
                                                s=pluralize(limit))
         self.fields['role'].help_text = message
示例#3
0
 def __init__(self, *args, **kwargs):
     _AuthorForm.__init__(self, *args, **kwargs)
     ## Add a note to the 'role' help text indicating how many admins
     ## are permitted with this kind of account.
     self.tier = SiteTierInfo.objects.get_current().tier
     if self.tier.admin_limit is not None:
         # For backwards-compatibility, pretend the site owner (a
         # superuser) counts toward the limit.
         limit = self.tier.admin_limit + 1
         message = ('With a {tier_name}, you may have {limit} '
                    'administrator{s}.').format(tier_name=self.tier.name,
                                                limit=limit,
                                                s=pluralize(limit))
         self.fields['role'].help_text = message