#NEWLINE# def add_tumblelog_signal( sender , instance , user = None , publish = None , title = None , **kwargs ) : #NEWLINE# #INDENT# 'This is a generic singal for adding an object to the Tumblelog.\n\t' #NEWLINE# ctype = ContentType . objects . get_for_model ( instance ) #NEWLINE# ( obj , created ) = Post . objects . get_or_create ( content_type = ctype , object_id = instance . id , defaults = { #NEWLINE# #INDENT# 'publish' : datetime . datetime . now ( ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# if user : #NEWLINE# #INDENT# obj . author = user #NEWLINE# #UNINDENT# if obj : #NEWLINE# #INDENT# obj . title = title #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# obj . title = instance . __unicode__ ( ) #NEWLINE# #UNINDENT# if publish : #NEWLINE# #INDENT# obj . publish = publish #NEWLINE# #UNINDENT# obj . save ( )