# HG changeset patch # User Steve Losh # Date 1263026538 18000 # Node ID da98105753a11d1b57d4070959b67826468bcc02 # Parent 87dafa5e8959cd3a6b7a301aa1727cb5b2c6532a Fix some comment exporting issues. diff -r 87dafa5e8959 -r da98105753a1 blog/models.py --- a/blog/models.py Sat Jan 09 01:01:28 2010 -0500 +++ b/blog/models.py Sat Jan 09 03:42:18 2010 -0500 @@ -15,7 +15,7 @@ verbose_name_plural = 'entries' def get_absolute_url(self): - return u'/blog/%d/%d/%s/' % (self.pub_date.year, self.pub_date.month, self.slug) + return u'/blog/%d/%02d/%s/' % (self.pub_date.year, self.pub_date.month, self.slug) def __unicode__(self): return u'%s' % (self.title,) diff -r 87dafa5e8959 -r da98105753a1 convert-comments.py --- a/convert-comments.py Sat Jan 09 01:01:28 2010 -0500 +++ b/convert-comments.py Sat Jan 09 03:42:18 2010 -0500 @@ -4,12 +4,15 @@ import settings setup_environ(settings) +from markdown import Markdown from django.contrib.comments.models import Comment from django.contrib.sites.models import Site from stevelosh.blog.models import Comment as BlogComment from stevelosh.projects.models import Comment as ProjectComment +mdown = Markdown() + site = Site.objects.all()[0] blog_comments = BlogComment.objects.filter(spam=False) project_comments = ProjectComment.objects.filter(spam=False) @@ -18,22 +21,22 @@ c = Comment() c.content_object = bc.entry c.user_name = bc.name - c.comment = bc.body + c.comment = mdown.convert(bc.body) c.submit_date = bc.submitted c.site = site c.is_public = True c.is_removed = False c.save() - print 'http://%s%s' % (site.domain, c.content_object.get_absolute_url()) + # print 'http://%s%s' % (site.domain, c.content_object.get_absolute_url()) for pc in project_comments: c = Comment() c.content_object = pc.project c.user_name = pc.name - c.comment = pc.body + c.comment = mdown.convert(pc.body) c.submit_date = pc.submitted c.site = site c.is_public = True c.is_removed = False c.save() - print 'http://%s%s' % (site.domain, c.content_object.get_absolute_url()) + # print 'http://%s%s' % (site.domain, c.content_object.get_absolute_url())