#NEWLINE# def make_featured( self , topic = None ) : #NEWLINE# #INDENT# if ( self . topics . count ( ) == 1 ) : #NEWLINE# #INDENT# t = self . topics . all ( ) [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if topic : #NEWLINE# #INDENT# if ( topic in self . topics . all ( ) ) : #NEWLINE# #INDENT# t = topic #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# #UNINDENT# try : #NEWLINE# #INDENT# fr = FeaturedResource . objects . get ( topic = t , resource_type = self . resource_type ) #NEWLINE# fr . resource = self #NEWLINE# fr . save ( ) #NEWLINE# #UNINDENT# except FeaturedResource . DoesNotExist : #NEWLINE# #INDENT# fr = FeaturedResource . objects . create ( topic = t , resource_type = fr . resource_type , resource = self ) #NEWLINE# #UNINDENT# return True