#NEWLINE# def post_through_setup( self , cls ) : #NEWLINE# #INDENT# if ( RelatedObject is not None ) : #NEWLINE# #INDENT# self . related = RelatedObject ( cls , self . model , self ) #NEWLINE# #UNINDENT# self . use_gfk = ( ( self . through is None ) or issubclass ( self . through , CommonGenericTaggedItemBase ) ) #NEWLINE# if ( VERSION >= ( 1 , 9 ) ) : #NEWLINE# #INDENT# if ( not self . remote_field . model ) : #NEWLINE# #INDENT# self . remote_field . model = self . through . _meta . get_field ( 'tag' ) . remote_field . model #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( not self . rel . to ) : #NEWLINE# #INDENT# self . rel . to = self . through . _meta . get_field ( 'tag' ) . rel . to #NEWLINE# #UNINDENT# #UNINDENT# if ( RelatedObject is not None ) : #NEWLINE# #INDENT# self . related = RelatedObject ( self . through , cls , self ) #NEWLINE# #UNINDENT# if self . use_gfk : #NEWLINE# #INDENT# tagged_items = GenericRelation ( self . through ) #NEWLINE# tagged_items . contribute_to_class ( cls , 'tagged_items' ) #NEWLINE# #UNINDENT# for rel in cls . _meta . local_many_to_many : #NEWLINE# #INDENT# if ( ( rel == self ) or ( not isinstance ( rel , TaggableManager ) ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( rel . through == self . through ) : #NEWLINE# #INDENT# raise ValueError ( "You can't have two TaggableManagers with the same through model." )