Private
Public Access
Implements Folder/Feed/Subscription (feeds app) and Article/ UserArticleState/Tag/ArticleTag (articles app), preserving the shared-Feed/shared-Article dedup design: a feed is fetched once regardless of subscriber count, and per-user read/star/save/hide state is created lazily rather than eagerly per subscriber. Adds the fetch pipeline: feedparser-based parsing with conditional GET (ETag/Last-Modified), nh3 HTML sanitization, guid-based dedup with content-hash change detection that never resets a user's read/star state, and exponential backoff on fetch errors respecting a configured minimum interval floor. Wired into Celery via poll_due_feeds/fetch_feed tasks, plus a minimal "add feed by URL" view that fetches synchronously so new subscribers see results immediately. Verified live against a real feed (hnrss.org) for ingestion, 304 dedup, and error backoff, in addition to the unit/integration test suite (28 tests, all passing). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
30 lines
714 B
Python
30 lines
714 B
Python
from django.contrib import admin
|
|
|
|
from .models import Feed, Folder, Subscription
|
|
|
|
|
|
@admin.register(Folder)
|
|
class FolderAdmin(admin.ModelAdmin):
|
|
list_display = ["name", "user", "order"]
|
|
list_filter = ["user"]
|
|
|
|
|
|
@admin.register(Feed)
|
|
class FeedAdmin(admin.ModelAdmin):
|
|
list_display = [
|
|
"title",
|
|
"feed_url",
|
|
"last_fetch_status",
|
|
"last_fetched_at",
|
|
"fetch_error_count",
|
|
"is_active",
|
|
]
|
|
list_filter = ["last_fetch_status", "is_active"]
|
|
search_fields = ["title", "feed_url"]
|
|
|
|
|
|
@admin.register(Subscription)
|
|
class SubscriptionAdmin(admin.ModelAdmin):
|
|
list_display = ["user", "feed", "folder", "custom_title"]
|
|
list_filter = ["user", "folder"]
|