from django.db import models


class Activity(models.Model):
    entry = models.ForeignKey('feeds.Entry', blank=True, null=True,
                              unique=True)
    published_on = models.DateTimeField(auto_now_add=True)

    def __unicode__(self):
        return u'%s:%s => %s' % (self.source_class, self.source_id, self.title)

    def from_feed(self):
        return self.entry != None


def broadcast(source):
    return Activity.objects.create(
        entry=source
    )

from django.db import models


class Activity(models.Model):
    entry = models.ForeignKey('feeds.Entry', blank=True, null=True,
                              unique=True)
    published_on = models.DateTimeField(auto_now_add=True)

    def __unicode__(self):
        return u'%d: Entry: %s' % (self.pk, self.entry)


def broadcast(source):
    return Activity.objects.create(
        entry=source
    )

Remove reference to old field and unused method
Remove reference to old field and unused method

  from django.db import models
  
  
  class Activity(models.Model):
      entry = models.ForeignKey('feeds.Entry', blank=True, null=True,
                                unique=True)
      published_on = models.DateTimeField(auto_now_add=True)
  
      def __unicode__(self):
+         return u'%d: Entry: %s' % (self.pk, self.entry)
-         return u'%s:%s => %s' % (self.source_class, self.source_id, self.title)
- 
-     def from_feed(self):
-         return self.entry != None
  
  
  def broadcast(source):
      return Activity.objects.create(
          entry=source
      )
  
Remove reference to old field and unused method
## Code Before:
from django.db import models


class Activity(models.Model):
    entry = models.ForeignKey('feeds.Entry', blank=True, null=True,
                              unique=True)
    published_on = models.DateTimeField(auto_now_add=True)

    def __unicode__(self):
        return u'%s:%s => %s' % (self.source_class, self.source_id, self.title)

    def from_feed(self):
        return self.entry != None


def broadcast(source):
    return Activity.objects.create(
        entry=source
    )

## Instruction:
Remove reference to old field and unused method
## Code After:
from django.db import models


class Activity(models.Model):
    entry = models.ForeignKey('feeds.Entry', blank=True, null=True,
                              unique=True)
    published_on = models.DateTimeField(auto_now_add=True)

    def __unicode__(self):
        return u'%d: Entry: %s' % (self.pk, self.entry)


def broadcast(source):
    return Activity.objects.create(
        entry=source
    )
