<s> from django . contrib . contenttypes import generic <EOL> from django . db import models <EOL> from django . template . defaultfilters import slugify <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from django . conf import settings <EOL> from facebook . modules . base import Base , AdminBase <EOL> class Profile ( Base ) : <EOL> """<STR_LIT>""" <EOL> id = models . BigIntegerField ( primary_key = True , unique = True , help_text = _ ( '<STR_LIT>' ) ) <EOL> _name = models . CharField ( max_length = <NUM_LIT:200> , blank = True , null = True ) <EOL> _username = models . CharField ( max_length = <NUM_LIT:200> , blank = True , unique = True , null = True ) <EOL> _link = models . URLField ( max_length = <NUM_LIT:255> , blank = True , null = True ) <EOL> _picture = models . URLField ( max_length = <NUM_LIT> , blank = True , null = True , help_text = _ ( '<STR_LIT>' ) ) <EOL> _pic_square = models . URLField ( max_length = <NUM_LIT> , blank = True , null = True , editable = False ) <EOL> _pic_small = models . URLField ( max_length = <NUM_LIT> , blank = True , null = True , editable = False ) <EOL> _pic_large = models . URLField ( max_length = <NUM_LIT> , blank = True , null = True , editable = False ) <EOL> _pic_crop = models . URLField ( max_length = <NUM_LIT> , blank = True , null = True , editable = False ) <EOL> if '<STR_LIT>' in settings . INSTALLED_APPS : <EOL> post_throughs = generic . GenericRelation ( '<STR_LIT>' , <EOL> related_name = "<STR_LIT>" ) <EOL> class Meta ( Base . Meta ) : <EOL> abstract = True <EOL> app_label = '<STR_LIT>' <EOL> def clean ( self ) : <EOL> super ( Profile , self ) . clean ( ) <EOL> self . _username = self . _username or None <EOL> def generate_slug ( self ) : <EOL> if self . _username : <EOL> if len ( self . _username ) >= <NUM_LIT:50> : <EOL> self . slug = '<STR_LIT>' % ( slugify ( self . _username ) [ : <NUM_LIT> ] , self . id ) <EOL> self . slug = slugify ( self . _username ) [ : <NUM_LIT:50> ] <EOL> elif self . _name : <EOL> self . slug = slugify ( '<STR_LIT>' % ( self . _name [ : <NUM_LIT> ] , self . id ) ) <EOL> else : <EOL> self . slug = slugify ( self . id ) <EOL> class ProfileAdmin ( AdminBase ) : <EOL> def pic_img ( self , obj ) : <EOL> return '<STR_LIT>' % obj . _picture if obj . _picture else '<STR_LIT>' <EOL> pic_img . allow_tags = True <EOL> pic_img . short_description = _ ( '<STR_LIT>' ) </s>
