<s> from hashlib import md5 <EOL> import mistune <EOL> from django . contrib . auth . models import User <EOL> from django . db import models <EOL> class RedditUser ( models . Model ) : <EOL> user = models . OneToOneField ( User ) <EOL> first_name = models . CharField ( max_length = <NUM_LIT> , null = True , default = None , <EOL> blank = True ) <EOL> last_name = models . CharField ( max_length = <NUM_LIT> , null = True , default = None , <EOL> blank = True ) <EOL> email = models . EmailField ( null = True , blank = True , default = None ) <EOL> about_text = models . TextField ( blank = True , null = True , max_length = <NUM_LIT> , <EOL> default = None ) <EOL> about_html = models . TextField ( blank = True , null = True , default = None ) <EOL> gravatar_hash = models . CharField ( max_length = <NUM_LIT:32> , null = True , blank = True , <EOL> default = None ) <EOL> display_picture = models . NullBooleanField ( default = False ) <EOL> homepage = models . URLField ( null = True , blank = True , default = None ) <EOL> twitter = models . CharField ( null = True , blank = True , max_length = <NUM_LIT:15> , <EOL> default = None ) <EOL> github = models . CharField ( null = True , blank = True , max_length = <NUM_LIT> , <EOL> default = None ) <EOL> comment_karma = models . IntegerField ( default = <NUM_LIT:0> ) <EOL> link_karma = models . IntegerField ( default = <NUM_LIT:0> ) <EOL> def update_profile_data ( self ) : <EOL> self . about_html = mistune . markdown ( self . about_text ) <EOL> if self . display_picture : <EOL> self . gravatar_hash = md5 ( self . email . lower ( ) . encode ( '<STR_LIT:utf-8>' ) ) . hexdigest ( ) <EOL> def __unicode__ ( self ) : <EOL> return "<STR_LIT>" . format ( self . user . username ) </s>
