<s> import django <EOL> from django . db import models <EOL> from django . utils . encoding import python_2_unicode_compatible <EOL> @ python_2_unicode_compatible <EOL> class Player ( models . Model ) : <EOL> state = models . IntegerField ( default = <NUM_LIT:0> ) <EOL> def __str__ ( self ) : <EOL> return '<STR_LIT>' % self . pk <EOL> @ python_2_unicode_compatible <EOL> class Abstract ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> def __str__ ( self ) : <EOL> return self . name <EOL> class Meta : <EOL> abstract = True <EOL> class Unregistered ( Abstract ) : <EOL> pass <EOL> if django . VERSION [ : <NUM_LIT:2> ] >= ( <NUM_LIT:1> , <NUM_LIT:5> ) : <EOL> from django . contrib . auth . models import AbstractBaseUser , BaseUserManager , PermissionsMixin <EOL> class MyUserManager ( BaseUserManager ) : <EOL> def create_user ( self , username , password = None ) : <EOL> user = self . model ( username = username ) <EOL> user . set_password ( password ) <EOL> user . save ( using = self . _db ) <EOL> return user <EOL> def create_superuser ( self , username , password ) : <EOL> user = self . create_user ( username , password = password ) <EOL> user . is_superuser = True <EOL> user . save ( using = self . _db ) <EOL> return user <EOL> class MyUser ( AbstractBaseUser , PermissionsMixin ) : <EOL> username = models . CharField ( max_length = <NUM_LIT:255> , unique = True ) <EOL> is_active = models . BooleanField ( default = True ) <EOL> is_staff = models . BooleanField ( default = True ) <EOL> objects = MyUserManager ( ) <EOL> USERNAME_FIELD = '<STR_LIT:username>' <EOL> def get_full_name ( self ) : <EOL> return self . username <EOL> get_short_name = get_full_name <EOL> if django . VERSION [ : <NUM_LIT:2> ] < ( <NUM_LIT:1> , <NUM_LIT:7> ) : <EOL> from actstream . runtests . testapp . apps import TestappConfig <EOL> TestappConfig ( ) . ready ( ) </s>
