<s> from __future__ import absolute_import <EOL> from django . contrib . auth . models import User <EOL> from django . db import models <EOL> class Animal ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT> ) <EOL> latin_name = models . CharField ( max_length = <NUM_LIT> ) <EOL> count = models . IntegerField ( ) <EOL> weight = models . FloatField ( ) <EOL> specimens = models . Manager ( ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> class Plant ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT> ) <EOL> class Meta : <EOL> db_table = "<STR_LIT>" <EOL> class Stuff ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:20> , null = True ) <EOL> owner = models . ForeignKey ( User , null = True ) <EOL> def __unicode__ ( self ) : <EOL> return unicode ( self . name ) + u'<STR_LIT>' + unicode ( self . owner ) <EOL> class Absolute ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT> ) <EOL> load_count = <NUM_LIT:0> <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> super ( Absolute , self ) . __init__ ( * args , ** kwargs ) <EOL> Absolute . load_count += <NUM_LIT:1> <EOL> class Parent ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> class Meta : <EOL> ordering = ( '<STR_LIT:id>' , ) <EOL> class Child ( Parent ) : <EOL> data = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> class Channel ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> class Article ( models . Model ) : <EOL> title = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> channels = models . ManyToManyField ( Channel ) <EOL> class Meta : <EOL> ordering = ( '<STR_LIT:id>' , ) <EOL> class Widget ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> class Meta : <EOL> ordering = ( '<STR_LIT:name>' , ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> class WidgetProxy ( Widget ) : <EOL> class Meta : <EOL> proxy = True <EOL> class TestManager ( models . Manager ) : <EOL> def get_by_natural_key ( self , key ) : <EOL> return self . get ( name = key ) <EOL> class Store ( models . Model ) : <EOL> objects = TestManager ( ) <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> class Meta : <EOL> ordering = ( '<STR_LIT:name>' , ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> def natural_key ( self ) : <EOL> return ( self . name , ) <EOL> class Person ( models . Model ) : <EOL> objects = TestManager ( ) <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> class Meta : <EOL> ordering = ( '<STR_LIT:name>' , ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> def natural_key ( self ) : <EOL> return ( self . name , ) <EOL> natural_key . dependencies = [ '<STR_LIT>' ] <EOL> class Book ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> author = models . ForeignKey ( Person ) <EOL> stores = models . ManyToManyField ( Store ) <EOL> class Meta : <EOL> ordering = ( '<STR_LIT:name>' , ) <EOL> def __unicode__ ( self ) : <EOL> return u'<STR_LIT>' % ( <EOL> self . name , <EOL> self . author . name , <EOL> '<STR_LIT:U+002CU+0020>' . join ( s . name for s in self . stores . all ( ) ) <EOL> ) <EOL> class NKManager ( models . Manager ) : <EOL> def get_by_natural_key ( self , data ) : <EOL> return self . get ( data = data ) <EOL> class NKChild ( Parent ) : <EOL> data = models . CharField ( max_length = <NUM_LIT:10> , unique = True ) <EOL> objects = NKManager ( ) <EOL> def natural_key ( self ) : <EOL> return self . data <EOL> def __unicode__ ( self ) : <EOL> return u'<STR_LIT>' % ( self . name , self . data ) <EOL> class RefToNKChild ( models . Model ) : <EOL> text = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> nk_fk = models . ForeignKey ( NKChild , related_name = '<STR_LIT>' ) <EOL> nk_m2m = models . ManyToManyField ( NKChild , related_name = '<STR_LIT>' ) <EOL> def __unicode__ ( self ) : <EOL> return u'<STR_LIT>' % ( <EOL> self . text , <EOL> self . nk_fk , <EOL> '<STR_LIT:U+002CU+0020>' . join ( str ( o ) for o in self . nk_m2m . all ( ) ) <EOL> ) <EOL> class Circle1 ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> def natural_key ( self ) : <EOL> return self . name <EOL> natural_key . dependencies = [ '<STR_LIT>' ] <EOL> class Circle2 ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> def natural_key ( self ) : <EOL> return self . name <EOL> natural_key . dependencies = [ '<STR_LIT>' ] <EOL> class Circle3 ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> def natural_key ( self ) : <EOL> return self . name <EOL> natural_key . dependencies = [ '<STR_LIT>' ] <EOL> class Circle4 ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> def natural_key ( self ) : <EOL> return self . name <EOL> natural_key . dependencies = [ '<STR_LIT>' ] <EOL> class Circle5 ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> def natural_key ( self ) : <EOL> return self . name <EOL> natural_key . dependencies = [ '<STR_LIT>' ] <EOL> class Circle6 ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> def natural_key ( self ) : <EOL> return self . name <EOL> natural_key . dependencies = [ '<STR_LIT>' ] <EOL> class ExternalDependency ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> def natural_key ( self ) : <EOL> return self . name <EOL> natural_key . dependencies = [ '<STR_LIT>' ] <EOL> class Thingy ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) </s>
