<s> from django . db . models import * <EOL> from django . contrib . auth . models import User <EOL> from django . contrib import admin <EOL> from django . core . mail import send_mail <EOL> from shared . utils import * <EOL> notify = False <EOL> class BlogPost ( BaseModel ) : <EOL> title = CharField ( max_length = <NUM_LIT> ) <EOL> body = TextField ( ) <EOL> created = DateTimeField ( auto_now_add = True ) <EOL> class Meta : <EOL> ordering = [ "<STR_LIT>" ] <EOL> def __unicode__ ( self ) : <EOL> return self . title <EOL> class BlogComment ( BaseModel ) : <EOL> author = CharField ( max_length = <NUM_LIT> , blank = True ) <EOL> body = TextField ( ) <EOL> post = ForeignKey ( BlogPost , related_name = "<STR_LIT>" , blank = True , null = True ) <EOL> created = DateTimeField ( auto_now_add = True ) <EOL> def __unicode__ ( self ) : <EOL> return u"<STR_LIT>" % ( self . post , self . body [ : <NUM_LIT> ] ) <EOL> def save ( self , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> if notify : <EOL> tpl = "<STR_LIT>" <EOL> message = tpl % ( self . post , self . author , self . body ) <EOL> from_addr = "<STR_LIT>" <EOL> recipient_list = [ "<STR_LIT>" ] <EOL> send_mail ( "<STR_LIT>" , message , from_addr , recipient_list ) <EOL> super ( BlogComment , self ) . save ( * args , ** kwargs ) </s>
