<s> from django . db import models <EOL> from django . contrib . contenttypes import generic <EOL> from django . contrib . contenttypes . models import ContentType <EOL> __all__ = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> class Link ( models . Model ) : <EOL> content_type = models . ForeignKey ( ContentType ) <EOL> object_id = models . PositiveIntegerField ( ) <EOL> content_object = generic . GenericForeignKey ( ) <EOL> def __unicode__ ( self ) : <EOL> return "<STR_LIT>" % ( self . content_type , self . object_id ) <EOL> class Place ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> links = generic . GenericRelation ( Link ) <EOL> def __unicode__ ( self ) : <EOL> return "<STR_LIT>" % self . name <EOL> class Restaurant ( Place ) : <EOL> def __unicode__ ( self ) : <EOL> return "<STR_LIT>" % self . name <EOL> class Address ( models . Model ) : <EOL> street = models . CharField ( max_length = <NUM_LIT> ) <EOL> city = models . CharField ( max_length = <NUM_LIT:50> ) <EOL> state = models . CharField ( max_length = <NUM_LIT:2> ) <EOL> zipcode = models . CharField ( max_length = <NUM_LIT:5> ) <EOL> content_type = models . ForeignKey ( ContentType ) <EOL> object_id = models . PositiveIntegerField ( ) <EOL> content_object = generic . GenericForeignKey ( ) <EOL> def __unicode__ ( self ) : <EOL> return '<STR_LIT>' % ( self . street , self . city , self . state , self . zipcode ) <EOL> class Person ( models . Model ) : <EOL> account = models . IntegerField ( primary_key = True ) <EOL> name = models . CharField ( max_length = <NUM_LIT> ) <EOL> addresses = generic . GenericRelation ( Address ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> class CharLink ( models . Model ) : <EOL> content_type = models . ForeignKey ( ContentType ) <EOL> object_id = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> content_object = generic . GenericForeignKey ( ) <EOL> class TextLink ( models . Model ) : <EOL> content_type = models . ForeignKey ( ContentType ) <EOL> object_id = models . TextField ( ) <EOL> content_object = generic . GenericForeignKey ( ) <EOL> class OddRelation1 ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> clinks = generic . GenericRelation ( CharLink ) <EOL> class OddRelation2 ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> tlinks = generic . GenericRelation ( TextLink ) <EOL> class Note ( models . Model ) : <EOL> content_type = models . ForeignKey ( ContentType ) <EOL> object_id = models . PositiveIntegerField ( ) <EOL> content_object = generic . GenericForeignKey ( ) <EOL> note = models . TextField ( ) <EOL> class Contact ( models . Model ) : <EOL> notes = generic . GenericRelation ( Note ) <EOL> class Organization ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> contacts = models . ManyToManyField ( Contact , related_name = '<STR_LIT>' ) </s>
