<s> from django . db import models <EOL> from taggit . managers import TaggableManager <EOL> from taggit . models import ( TaggedItemBase , GenericTaggedItemBase , TaggedItem , <EOL> TagBase , Tag ) <EOL> class Food ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:50> ) <EOL> tags = TaggableManager ( ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> class Pet ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:50> ) <EOL> tags = TaggableManager ( ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> class HousePet ( Pet ) : <EOL> trained = models . BooleanField ( ) <EOL> class TaggedFood ( TaggedItemBase ) : <EOL> content_object = models . ForeignKey ( '<STR_LIT>' ) <EOL> class TaggedPet ( TaggedItemBase ) : <EOL> content_object = models . ForeignKey ( '<STR_LIT>' ) <EOL> class DirectFood ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:50> ) <EOL> tags = TaggableManager ( through = "<STR_LIT>" ) <EOL> class DirectPet ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:50> ) <EOL> tags = TaggableManager ( through = TaggedPet ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> class DirectHousePet ( DirectPet ) : <EOL> trained = models . BooleanField ( ) <EOL> class TaggedCustomPKFood ( TaggedItemBase ) : <EOL> content_object = models . ForeignKey ( '<STR_LIT>' ) <EOL> class TaggedCustomPKPet ( TaggedItemBase ) : <EOL> content_object = models . ForeignKey ( '<STR_LIT>' ) <EOL> class CustomPKFood ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:50> , primary_key = True ) <EOL> tags = TaggableManager ( through = TaggedCustomPKFood ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> class CustomPKPet ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:50> , primary_key = True ) <EOL> tags = TaggableManager ( through = TaggedCustomPKPet ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> class CustomPKHousePet ( CustomPKPet ) : <EOL> trained = models . BooleanField ( ) <EOL> class OfficialTag ( TagBase ) : <EOL> official = models . BooleanField ( ) <EOL> class OfficialThroughModel ( GenericTaggedItemBase ) : <EOL> tag = models . ForeignKey ( OfficialTag , related_name = "<STR_LIT>" ) <EOL> class OfficialFood ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:50> ) <EOL> tags = TaggableManager ( through = OfficialThroughModel ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> class OfficialPet ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:50> ) <EOL> tags = TaggableManager ( through = OfficialThroughModel ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> class OfficialHousePet ( OfficialPet ) : <EOL> trained = models . BooleanField ( ) <EOL> class Media ( models . Model ) : <EOL> tags = TaggableManager ( ) <EOL> class Meta : <EOL> abstract = True <EOL> class Photo ( Media ) : <EOL> pass <EOL> class Movie ( Media ) : <EOL> pass <EOL> class ArticleTag ( Tag ) : <EOL> class Meta : <EOL> proxy = True <EOL> def slugify ( self , tag , i = None ) : <EOL> slug = "<STR_LIT>" % tag . lower ( ) <EOL> if i is not None : <EOL> slug += "<STR_LIT>" % i <EOL> return slug <EOL> class ArticleTaggedItem ( TaggedItem ) : <EOL> class Meta : <EOL> proxy = True <EOL> @ classmethod <EOL> def tag_model ( self ) : <EOL> return ArticleTag <EOL> class Article ( models . Model ) : <EOL> title = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> tags = TaggableManager ( through = ArticleTaggedItem ) </s>
