<s> import os <EOL> from django . db import models <EOL> from core . models import PlCoreBase <EOL> from core . models . plcorebase import StrippedCharField <EOL> def get_default_serviceclass ( ) : <EOL> try : <EOL> return ServiceClass . objects . get ( name = "<STR_LIT>" ) <EOL> except ServiceClass . DoesNotExist : <EOL> return None <EOL> class ServiceClass ( PlCoreBase ) : <EOL> name = StrippedCharField ( max_length = <NUM_LIT:32> ) <EOL> description = StrippedCharField ( max_length = <NUM_LIT:255> ) <EOL> commitment = models . IntegerField ( default = <NUM_LIT> ) <EOL> membershipFee = models . IntegerField ( default = <NUM_LIT:0> ) <EOL> membershipFeeMonths = models . IntegerField ( default = <NUM_LIT:12> ) <EOL> upgradeRequiresApproval = models . BooleanField ( default = False ) <EOL> upgradeFrom = models . ManyToManyField ( '<STR_LIT>' , blank = True , null = True ) <EOL> class Meta ( PlCoreBase . Meta ) : <EOL> verbose_name_plural = "<STR_LIT>" <EOL> def __unicode__ ( self ) : return u'<STR_LIT:%s>' % ( self . name ) <EOL> def save_by_user ( self , user , * args , ** kwds ) : <EOL> if self . can_update ( user ) : <EOL> super ( ServiceClass , self ) . save ( * args , ** kwds ) </s>
