# Path: apps/feeds/models.py
# class Feed(models.Model):
#     feed_url = models.URLField()
#     list_id = models.IntegerField(blank=True, null=True)
#     created_by = models.ForeignKey(settings.AUTH_USER_MODEL)
# 
#     date_created = models.DateTimeField(auto_now_add=True)
#     date_modified = models.DateTimeField(auto_now=True)
# 
#     class Meta:
#         unique_together = ('feed_url', 'created_by')
# 
#     def __unicode__(self):
#         return self.feed_url
# 
# class FeedEntry(models.Model):
#     title = models.CharField(max_length=255, blank=True)
#     summary = models.TextField(blank=True)
#     link = models.URLField()
#     feed = models.ForeignKey(Feed)
# 
#     added_to_kippt = models.BooleanField(default=False)
#     date_added_to_kippt = models.DateTimeField(blank=True, null=True)
# 
#     date_created = models.DateTimeField(auto_now_add=True)
#     date_modified = models.DateTimeField(auto_now=True)
# 
#     class Meta:
#         verbose_name_plural = 'feed entries'
# 
#     def __unicode__(self):
#         return self.title


from django.contrib import admin
from .models import Feed, FeedEntry



class FeedAdmin(admin.ModelAdmin):
    list_display = ('feed_url', 'created_by')


class FeedEntryAdmin(admin.ModelAdmin):
    list_display = ('title', 'link', 'feed',
                    'feed_created_by', 'added_to_kippt')

    def feed_created_by(self, obj):
        return obj.feed.created_by
    feed_created_by.short_description = 'Created by'


admin.site.register(Feed, FeedAdmin)

# Path: apps/feeds/models.py
# class Feed(models.Model):
#     feed_url = models.URLField()
#     list_id = models.IntegerField(blank=True, null=True)
#     created_by = models.ForeignKey(settings.AUTH_USER_MODEL)
# 
#     date_created = models.DateTimeField(auto_now_add=True)
#     date_modified = models.DateTimeField(auto_now=True)
# 
#     class Meta:
#         unique_together = ('feed_url', 'created_by')
# 
#     def __unicode__(self):
#         return self.feed_url
# 
# class FeedEntry(models.Model):
#     title = models.CharField(max_length=255, blank=True)
#     summary = models.TextField(blank=True)
#     link = models.URLField()
#     feed = models.ForeignKey(Feed)
# 
#     added_to_kippt = models.BooleanField(default=False)
#     date_added_to_kippt = models.DateTimeField(blank=True, null=True)
# 
#     date_created = models.DateTimeField(auto_now_add=True)
#     date_modified = models.DateTimeField(auto_now=True)
# 
#     class Meta:
#         verbose_name_plural = 'feed entries'
# 
#     def __unicode__(self):
#         return self.title


# Path: apps/feeds/admin.py
from django.contrib import admin
from .models import Feed, FeedEntry




class FeedAdmin(admin.ModelAdmin):
    list_display = ('feed_url', 'created_by')


class FeedEntryAdmin(admin.ModelAdmin):
    list_display = ('title', 'link', 'feed',
                    'feed_created_by', 'added_to_kippt')

    def feed_created_by(self, obj):
        return obj.feed.created_by
    feed_created_by.short_description = 'Created by'


admin.site.register(Feed, FeedAdmin)

admin.site.register(FeedEntry, FeedEntryAdmin)