#NEWLINE# def register_draft_only( model_class , fields , follow , format ) : #NEWLINE# #INDENT# '\n    version of the reversion register function that only registers drafts and\n    ignores public models\n    ' #NEWLINE# if revision_manager . is_registered ( model_class ) : #NEWLINE# #INDENT# raise RegistrationError ( ( '%r has already been registered with Reversion.' % model_class ) ) #NEWLINE# #UNINDENT# if ( model_class . _meta . proxy and ( not revision_manager . is_registered ( list ( model_class . _meta . parents . keys ( ) ) [ 0 ] ) ) ) : #NEWLINE# #INDENT# raise RegistrationError ( ( '%r is a proxy model, and its parent has not been registered withReversion.' % model_class ) ) #NEWLINE# #UNINDENT# opts = model_class . _meta #NEWLINE# local_fields = ( opts . local_fields + opts . local_many_to_many ) #NEWLINE# if ( fields is None ) : #NEWLINE# #INDENT# fields = [ field . name for field in local_fields ] #NEWLINE# #UNINDENT# fields = tuple ( fields ) #NEWLINE# follow = tuple ( follow ) #NEWLINE# registration_info = VersionAdapter ( model_class ) #NEWLINE# registration_info . fields = fields #NEWLINE# registration_info . follow = follow #NEWLINE# registration_info . format = format #NEWLINE# if hasattr ( revision_manager , '_registration_key_for_model' ) : #NEWLINE# #INDENT# model_key = revision_manager . _registration_key_for_model ( model_class ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# model_key = model_class #NEWLINE# #UNINDENT# revision_manager . _registered_models [ model_key ] = registration_info