Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed Feed.is_defunct field.

This field is no longer necessary. Defunct feeds should be set to
approval_status=models.DENIED_FEED. refs #19740
  • Loading branch information...
commit 5ed99e7c5a30dd627c6a5f6aac622d32762aa87d 1 parent 3d592f7
@timgraham timgraham authored
View
2  aggregator/admin.py
@@ -20,7 +20,7 @@ def mark_denied(modeladmin, request, queryset):
admin.site.register(Feed,
list_display=["title", "feed_type", "public_url", "approval_status"],
- list_filter=["feed_type", "is_defunct", "approval_status"],
+ list_filter=["feed_type", "approval_status"],
ordering=["title"],
search_fields=["title", "public_url"],
raw_id_fields=['owner'],
View
2  aggregator/forms.py
@@ -13,4 +13,4 @@ class FeedModelForm(forms.ModelForm):
class Meta:
model = Feed
- exclude = ('is_defunct', 'feed_type', 'owner', 'approval_status')
+ exclude = ('feed_type', 'owner', 'approval_status')
View
2  aggregator/management/commands/update_subscriptions.py
@@ -16,7 +16,7 @@
class Command(NoArgsCommand):
def handle_noargs(self, **kwargs):
feed_urls = set(Feed.objects.filter(
- is_defunct=False, approval_status=APPROVED_FEED
+ approval_status=APPROVED_FEED
).values_list('feed_url', flat=True))
subscribed_urls = set(Subscription.objects.values_list('topic',
View
88 aggregator/migrations/0006__del_field_feed_is_defunct.py
@@ -0,0 +1,88 @@
+# -*- coding: utf-8 -*-
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+ # Deleting field 'Feed.is_defunct'
+ db.delete_column(u'aggregator_feed', 'is_defunct')
+
+
+ def backwards(self, orm):
+ # Adding field 'Feed.is_defunct'
+ db.add_column(u'aggregator_feed', 'is_defunct',
+ self.gf('django.db.models.fields.BooleanField')(default=False),
+ keep_default=False)
+
+
+ models = {
+ u'aggregator.feed': {
+ 'Meta': {'object_name': 'Feed'},
+ 'approval_status': ('django.db.models.fields.CharField', [], {'default': "'P'", 'max_length': '1'}),
+ 'feed_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['aggregator.FeedType']"}),
+ 'feed_url': ('django.db.models.fields.URLField', [], {'unique': 'True', 'max_length': '500'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'owned_feeds'", 'null': 'True', 'to': u"orm['auth.User']"}),
+ 'public_url': ('django.db.models.fields.URLField', [], {'max_length': '500'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '500'})
+ },
+ u'aggregator.feeditem': {
+ 'Meta': {'ordering': "('-date_modified',)", 'object_name': 'FeedItem'},
+ 'date_modified': ('django.db.models.fields.DateTimeField', [], {}),
+ 'feed': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['aggregator.Feed']"}),
+ 'guid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '500', 'db_index': 'True'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'link': ('django.db.models.fields.URLField', [], {'max_length': '500'}),
+ 'summary': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '500'})
+ },
+ u'aggregator.feedtype': {
+ 'Meta': {'object_name': 'FeedType'},
+ 'can_self_add': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '250'})
+ },
+ u'auth.group': {
+ 'Meta': {'object_name': 'Group'},
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+ },
+ u'auth.permission': {
+ 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ u'auth.user': {
+ 'Meta': {'object_name': 'User'},
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ u'contenttypes.contenttype': {
+ 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ }
+ }
+
+ complete_apps = ['aggregator']
View
1  aggregator/models.py
@@ -36,7 +36,6 @@ class Feed(models.Model):
title = models.CharField(max_length=500)
feed_url = models.URLField(unique=True, max_length=500)
public_url = models.URLField(max_length=500)
- is_defunct = models.BooleanField()
approval_status = models.CharField(max_length=1, choices=STATUS_CHOICES, default=PENDING_FEED)
feed_type = models.ForeignKey(FeedType)
owner = models.ForeignKey(User, blank=True, null=True, related_name='owned_feeds')
View
10 aggregator/tests.py
@@ -30,16 +30,14 @@ def setUp(self):
self.feed_type = models.FeedType(name="Test Feed Type", slug="test-feed-type", can_self_add=True)
self.feed_type.save()
- self.approved_feed = models.Feed(title="Approved", feed_url="foo.com/rss/", public_url="foo.com/", is_defunct=False,
+ self.approved_feed = models.Feed(title="Approved", feed_url="foo.com/rss/", public_url="foo.com/",
approval_status=models.APPROVED_FEED, feed_type=self.feed_type)
- self.denied_feed = models.Feed(title="Denied", feed_url="bar.com/rss/", public_url="bar.com/", is_defunct=False,
+ self.denied_feed = models.Feed(title="Denied", feed_url="bar.com/rss/", public_url="bar.com/",
approval_status=models.DENIED_FEED, feed_type=self.feed_type)
- self.pending_feed = models.Feed(title="Pending", feed_url="baz.com/rss/", public_url="baz.com/", is_defunct=False,
+ self.pending_feed = models.Feed(title="Pending", feed_url="baz.com/rss/", public_url="baz.com/",
approval_status=models.PENDING_FEED, feed_type=self.feed_type)
- self.defunct_feed = models.Feed(title="Defunct", feed_url="zot.com/rss/", public_url="zot.com/", is_defunct=True,
- approval_status=models.APPROVED_FEED, feed_type=self.feed_type)
- for feed in [self.approved_feed, self.denied_feed, self.pending_feed, self.defunct_feed]:
+ for feed in [self.approved_feed, self.denied_feed, self.pending_feed]:
feed.save()
feed_item = models.FeedItem(feed=feed, title="%s Item" % feed.title, link=feed.public_url,
date_modified=datetime.datetime.now(), guid=feed.title)
Please sign in to comment.
Something went wrong with that request. Please try again.