<s> from django . db import models <EOL> try : <EOL> sorted <EOL> except NameError : <EOL> from django . utils . itercompat import sorted <EOL> class Author ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> age = models . IntegerField ( ) <EOL> friends = models . ManyToManyField ( '<STR_LIT>' , blank = True ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> class Publisher ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT> ) <EOL> num_awards = models . IntegerField ( ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> class Book ( models . Model ) : <EOL> isbn = models . CharField ( max_length = <NUM_LIT:9> ) <EOL> name = models . CharField ( max_length = <NUM_LIT> ) <EOL> pages = models . IntegerField ( ) <EOL> rating = models . FloatField ( ) <EOL> price = models . DecimalField ( decimal_places = <NUM_LIT:2> , max_digits = <NUM_LIT:6> ) <EOL> authors = models . ManyToManyField ( Author ) <EOL> contact = models . ForeignKey ( Author , related_name = '<STR_LIT>' ) <EOL> publisher = models . ForeignKey ( Publisher ) <EOL> pubdate = models . DateField ( ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> class Store ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT> ) <EOL> books = models . ManyToManyField ( Book ) <EOL> original_opening = models . DateTimeField ( ) <EOL> friday_night_closing = models . TimeField ( ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> __test__ = { '<STR_LIT>' : """<STR_LIT>""" } </s>
