From 662d2fd122ebf3b63ecf8cb2390c535edbc39d07 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sat, 10 Mar 2012 16:11:52 +0100 Subject: Fixed some things to work live --- aggregator/management/commands/loadfeeds.py | 9 +++++++-- aggregator/migrations/0001_initial.py | 2 +- aggregator/models.py | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'aggregator') diff --git a/aggregator/management/commands/loadfeeds.py b/aggregator/management/commands/loadfeeds.py index 8d9e83c..aff1799 100644 --- a/aggregator/management/commands/loadfeeds.py +++ b/aggregator/management/commands/loadfeeds.py @@ -32,10 +32,15 @@ class Command(BaseCommand): updated=updated, feed=feed) + if 'content' in entry.keys(): + content = entry.content[0]['value'] + else: + content = entry.summary + if feed.with_markdown: - post.body = markdown.markdown(entry.summary) + post.body = markdown.markdown(content) else: - post.body = entry.summary + post.body = content post.save() diff --git a/aggregator/migrations/0001_initial.py b/aggregator/migrations/0001_initial.py index 1cb4ade..dc3336e 100644 --- a/aggregator/migrations/0001_initial.py +++ b/aggregator/migrations/0001_initial.py @@ -27,7 +27,7 @@ class Migration(SchemaMigration): # Adding model 'Post' db.create_table('aggregator_post', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('post_id', self.gf('django.db.models.fields.CharField')(unique=True, max_length=500)), + ('post_id', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255)), ('title', self.gf('django.db.models.fields.CharField')(max_length=500)), ('body', self.gf('django.db.models.fields.TextField')()), ('remote_url', self.gf('django.db.models.fields.URLField')(max_length=255)), diff --git a/aggregator/models.py b/aggregator/models.py index d873e6c..b5c4f3c 100644 --- a/aggregator/models.py +++ b/aggregator/models.py @@ -25,7 +25,7 @@ class Feed(models.Model): ordering = [ '-updated' ] class Post(models.Model): - post_id = models.CharField(max_length=500, unique=True) + post_id = models.CharField(max_length=255, unique=True) title = models.CharField(max_length=500) body = models.TextField() remote_url = models.URLField(max_length=255) -- cgit v1.2.3-54-g00ecf