<s> from django . core . management . base import BaseCommand <EOL> from django . contrib . comments . models import Comment , FreeComment <EOL> from threadedcomments . models import ThreadedComment , FreeThreadedComment <EOL> class Command ( BaseCommand ) : <EOL> help = "<STR_LIT>" <EOL> output_transaction = True <EOL> def handle ( self , * args , ** options ) : <EOL> """<STR_LIT>""" <EOL> self . handle_free_comments ( ) <EOL> self . handle_comments ( ) <EOL> def handle_free_comments ( self ) : <EOL> """<STR_LIT>""" <EOL> comments = FreeComment . objects . all ( ) <EOL> for c in comments : <EOL> new = FreeThreadedComment ( <EOL> content_type = c . content_type , <EOL> object_id = c . object_id , <EOL> comment = c . comment , <EOL> name = c . person_name , <EOL> website = '<STR_LIT>' , <EOL> email = '<STR_LIT>' , <EOL> date_submitted = c . submit_date , <EOL> date_modified = c . submit_date , <EOL> date_approved = c . submit_date , <EOL> is_public = c . is_public , <EOL> ip_address = c . ip_address , <EOL> is_approved = c . approved <EOL> ) <EOL> new . save ( ) <EOL> def handle_comments ( self ) : <EOL> """<STR_LIT>""" <EOL> comments = Comment . objects . all ( ) <EOL> for c in comments : <EOL> new = ThreadedComment ( <EOL> content_type = c . content_type , <EOL> object_id = c . object_id , <EOL> comment = c . comment , <EOL> user = c . user , <EOL> date_submitted = c . submit_date , <EOL> date_modified = c . submit_date , <EOL> date_approved = c . submit_date , <EOL> is_public = c . is_public , <EOL> ip_address = c . ip_address , <EOL> is_approved = not c . is_removed <EOL> ) <EOL> new . save ( ) </s>
