<s> from django . db import models <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from django_elasticsearch . fields import EmbeddedModel <EOL> from djangotoolbox . fields import ListField , DictField <EOL> class Blog ( models . Model ) : <EOL> title = models . CharField ( max_length = <NUM_LIT:200> , db_index = True ) <EOL> def __unicode__ ( self ) : <EOL> return "<STR_LIT>" % self . title <EOL> class Entry ( models . Model ) : <EOL> title = models . CharField ( max_length = <NUM_LIT:200> , db_index = True , unique = True ) <EOL> content = models . CharField ( max_length = <NUM_LIT:1000> ) <EOL> date_published = models . DateTimeField ( null = True , blank = True ) <EOL> blog = models . ForeignKey ( Blog , null = True , blank = True ) <EOL> class MongoMeta : <EOL> descending_indexes = [ '<STR_LIT:title>' ] <EOL> def __unicode__ ( self ) : <EOL> return "<STR_LIT>" % ( self . title ) <EOL> class Person ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:20> ) <EOL> surname = models . CharField ( max_length = <NUM_LIT:20> ) <EOL> age = models . IntegerField ( null = True , blank = True ) <EOL> def __unicode__ ( self ) : <EOL> return u"<STR_LIT>" % ( self . name , self . surname ) <EOL> class StandardAutoFieldModel ( models . Model ) : <EOL> title = models . CharField ( max_length = <NUM_LIT:200> ) <EOL> def __unicode__ ( self ) : <EOL> return "<STR_LIT>" % ( self . title ) <EOL> class EModel ( EmbeddedModel ) : <EOL> title = models . CharField ( max_length = <NUM_LIT:200> ) <EOL> pos = models . IntegerField ( default = <NUM_LIT:10> ) <EOL> def test_func ( self ) : <EOL> return self . pos <EOL> class TestFieldModel ( models . Model ) : <EOL> title = models . CharField ( max_length = <NUM_LIT:200> ) <EOL> mlist = ListField ( ) <EOL> mlist_default = ListField ( default = [ "<STR_LIT:a>" , "<STR_LIT:b>" ] ) <EOL> mdict = DictField ( ) <EOL> mdict_default = DictField ( default = { "<STR_LIT:a>" : "<STR_LIT:a>" , '<STR_LIT:b>' : <NUM_LIT:1> } ) <EOL> class MongoMeta : <EOL> index_together = [ { <EOL> '<STR_LIT>' : [ ( '<STR_LIT:title>' , False ) , '<STR_LIT>' ] <EOL> } ] <EOL> def __unicode__ ( self ) : <EOL> return "<STR_LIT>" % ( self . title ) </s>
