<s> from django . db import models <EOL> from django . utils . encoding import python_2_unicode_compatible <EOL> class Event ( models . Model ) : <EOL> date = models . DateField ( db_column = "<STR_LIT>" ) <EOL> class Parent ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT> ) <EOL> class Child ( models . Model ) : <EOL> parent = models . ForeignKey ( Parent , editable = False , null = True ) <EOL> name = models . CharField ( max_length = <NUM_LIT:30> , blank = True ) <EOL> age = models . IntegerField ( null = True , blank = True ) <EOL> class Genre ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:20> ) <EOL> class Band ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:20> ) <EOL> nr_of_members = models . PositiveIntegerField ( ) <EOL> genres = models . ManyToManyField ( Genre ) <EOL> @ python_2_unicode_compatible <EOL> class Musician ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:30> ) <EOL> def __str__ ( self ) : <EOL> return self . name <EOL> @ python_2_unicode_compatible <EOL> class Group ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:30> ) <EOL> members = models . ManyToManyField ( Musician , through = '<STR_LIT>' ) <EOL> def __str__ ( self ) : <EOL> return self . name <EOL> class Membership ( models . Model ) : <EOL> music = models . ForeignKey ( Musician ) <EOL> group = models . ForeignKey ( Group ) <EOL> role = models . CharField ( max_length = <NUM_LIT:15> ) <EOL> class Quartet ( Group ) : <EOL> pass <EOL> class ChordsMusician ( Musician ) : <EOL> pass <EOL> class ChordsBand ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:30> ) <EOL> members = models . ManyToManyField ( ChordsMusician , through = '<STR_LIT>' ) <EOL> class Invitation ( models . Model ) : <EOL> player = models . ForeignKey ( ChordsMusician ) <EOL> band = models . ForeignKey ( ChordsBand ) <EOL> instrument = models . CharField ( max_length = <NUM_LIT:15> ) <EOL> class Swallow ( models . Model ) : <EOL> origin = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> load = models . FloatField ( ) <EOL> speed = models . FloatField ( ) <EOL> class Meta : <EOL> ordering = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> class UnorderedObject ( models . Model ) : <EOL> """<STR_LIT>""" <EOL> bool = models . BooleanField ( default = True ) <EOL> class OrderedObjectManager ( models . Manager ) : <EOL> def get_query_set ( self ) : <EOL> return super ( OrderedObjectManager , self ) . get_query_set ( ) . order_by ( '<STR_LIT>' ) <EOL> class OrderedObject ( models . Model ) : <EOL> """<STR_LIT>""" <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> bool = models . BooleanField ( default = True ) <EOL> number = models . IntegerField ( default = <NUM_LIT:0> , db_column = '<STR_LIT>' ) <EOL> objects = OrderedObjectManager ( ) </s>
