<s> from django . db import models <EOL> from django . utils . encoding import python_2_unicode_compatible <EOL> @ python_2_unicode_compatible <EOL> class User ( models . Model ) : <EOL> username = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> email = models . EmailField ( ) <EOL> def __str__ ( self ) : <EOL> return self . username <EOL> @ python_2_unicode_compatible <EOL> class UserProfile ( models . Model ) : <EOL> user = models . OneToOneField ( User ) <EOL> city = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> state = models . CharField ( max_length = <NUM_LIT:2> ) <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" % ( self . city , self . state ) <EOL> @ python_2_unicode_compatible <EOL> class UserStatResult ( models . Model ) : <EOL> results = models . CharField ( max_length = <NUM_LIT:50> ) <EOL> def __str__ ( self ) : <EOL> return '<STR_LIT>' % ( self . results , ) <EOL> @ python_2_unicode_compatible <EOL> class UserStat ( models . Model ) : <EOL> user = models . OneToOneField ( User , primary_key = True ) <EOL> posts = models . IntegerField ( ) <EOL> results = models . ForeignKey ( UserStatResult ) <EOL> def __str__ ( self ) : <EOL> return '<STR_LIT>' % ( self . posts , ) <EOL> @ python_2_unicode_compatible <EOL> class StatDetails ( models . Model ) : <EOL> base_stats = models . OneToOneField ( UserStat ) <EOL> comments = models . IntegerField ( ) <EOL> def __str__ ( self ) : <EOL> return '<STR_LIT>' % ( self . comments , ) <EOL> class AdvancedUserStat ( UserStat ) : <EOL> karma = models . IntegerField ( ) <EOL> class Image ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> class Product ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> image = models . OneToOneField ( Image , null = True ) <EOL> @ python_2_unicode_compatible <EOL> class Parent1 ( models . Model ) : <EOL> name1 = models . CharField ( max_length = <NUM_LIT:50> ) <EOL> def __str__ ( self ) : <EOL> return self . name1 <EOL> @ python_2_unicode_compatible <EOL> class Parent2 ( models . Model ) : <EOL> id2 = models . AutoField ( primary_key = True ) <EOL> name2 = models . CharField ( max_length = <NUM_LIT:50> ) <EOL> def __str__ ( self ) : <EOL> return self . name2 <EOL> @ python_2_unicode_compatible <EOL> class Child1 ( Parent1 , Parent2 ) : <EOL> value = models . IntegerField ( ) <EOL> def __str__ ( self ) : <EOL> return self . name1 <EOL> @ python_2_unicode_compatible <EOL> class Child2 ( Parent1 ) : <EOL> parent2 = models . OneToOneField ( Parent2 ) <EOL> value = models . IntegerField ( ) <EOL> def __str__ ( self ) : <EOL> return self . name1 <EOL> class Child3 ( Child2 ) : <EOL> value3 = models . IntegerField ( ) <EOL> class Child4 ( Child1 ) : <EOL> value4 = models . IntegerField ( ) </s>
