Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[website] changed some maxlengths to avoid crapping out in the aggreg…

…ator.

git-svn-id: http://code.djangoproject.com/svn/djangoproject.com@7296 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 62ed0d1c6df7db6017b0f417439b9d3df7d937fd 1 parent ecbf933
jacob authored
View
7 django_website/apps/aggregator/bin/update_feeds.py
@@ -9,9 +9,11 @@
import datetime
import feedparser
-def update_feeds():
+def update_feeds(verbose=False):
from django_website.apps.aggregator.models import Feed, FeedItem
for feed in Feed.objects.filter(is_defunct=False):
+ if verbose:
+ print feed
parsed_feed = feedparser.parse(feed.feed_url)
for entry in parsed_feed.entries:
title = entry.title.encode(parsed_feed.encoding, "xmlcharrefreplace")
@@ -51,7 +53,8 @@ def update_feeds():
if __name__ == '__main__':
parser = optparse.OptionParser()
parser.add_option('--settings')
+ parser.add_option('-v', '--verbose', action="store_true")
options, args = parser.parse_args()
if options.settings:
os.environ["DJANGO_SETTINGS_MODULE"] = options.settings
- update_feeds()
+ update_feeds(options.verbose)
View
12 django_website/apps/aggregator/models.py
@@ -1,9 +1,9 @@
from django.db import models
class Feed(models.Model):
- title = models.CharField(maxlength=200)
- feed_url = models.URLField(unique=True)
- public_url = models.URLField()
+ title = models.CharField(maxlength=500)
+ feed_url = models.URLField(unique=True, maxlength=500)
+ public_url = models.URLField(maxlength=500)
is_defunct = models.BooleanField()
class Meta:
@@ -17,11 +17,11 @@ def __unicode__(self):
class FeedItem(models.Model):
feed = models.ForeignKey(Feed)
- title = models.CharField(maxlength=200)
- link = models.URLField()
+ title = models.CharField(maxlength=500)
+ link = models.URLField(maxlength=500)
summary = models.TextField(blank=True)
date_modified = models.DateTimeField()
- guid = models.CharField(maxlength=200, unique=True, db_index=True)
+ guid = models.CharField(maxlength=500, unique=True, db_index=True)
class Meta:
db_table = 'aggregator_feeditems'
Please sign in to comment.
Something went wrong with that request. Please try again.