Mercurial > public > sg101
comparison gpp/legacy/management/commands/import_old_news.py @ 294:254db4cb6a86
Changes / scripts to import forums. Other tweaks and moving other import scripts to the legacy application.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 05 Jan 2011 04:09:35 +0000 |
parents | 2367c4795c92 |
children | 4021ea1045f7 |
comparison
equal
deleted
inserted
replaced
293:c92fb89dbc7d | 294:254db4cb6a86 |
---|---|
84 print "Could not find user %s for story %s; skipping." % ( | 84 print "Could not find user %s for story %s; skipping." % ( |
85 row['informant'], row['sid']) | 85 row['informant'], row['sid']) |
86 return | 86 return |
87 | 87 |
88 story = Story(id=int(row['sid']), | 88 story = Story(id=int(row['sid']), |
89 title=unescape(row['title']), | 89 title=unescape(row['title'].decode('latin-1')), |
90 submitter=submitter, | 90 submitter=submitter, |
91 category=self.topics[int(row['topic'])], | 91 category=self.topics[int(row['topic'])], |
92 short_text=row['hometext'], | 92 short_text=row['hometext'].decode('latin-1'), |
93 long_text=row['bodytext'], | 93 long_text=row['bodytext'].decode('latin-1'), |
94 date_submitted=datetime.strptime(row['time'], "%Y-%m-%d %H:%M:%S"), | 94 date_submitted=datetime.strptime(row['time'], "%Y-%m-%d %H:%M:%S"), |
95 allow_comments=True) | 95 allow_comments=True) |
96 | 96 |
97 story.save() | 97 story.save() |
98 | 98 |