:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(dags): add DuckLakeBackfill to django admin (#64161)
James Greenhill1a11d5e8315e
diff --git a/posthog/admin/admins/ducklake_backfill_admin.py b/posthog/admin/admins/ducklake_backfill_admin.pynew file mode 100644index 000000000000..510db229ea1f--- /dev/null+++ b/posthog/admin/admins/ducklake_backfill_admin.py@@ -0,0 +1,50 @@+from django.contrib import admin+from django.db.models import QuerySet+from django.http import HttpRequest++from posthog.models import DuckLakeBackfill++[email protected](DuckLakeBackfill)+class DuckLakeBackfillAdmin(admin.ModelAdmin):+ list_display = (+ "id",+ "team_id",+ "enabled",+ "created_by",+ "created_at",+ "updated_at",+ )+ list_filter = ("enabled",)+ search_fields = ("=team__id",)+ readonly_fields = ("id", "created_at", "updated_at")+ raw_id_fields = ("team", "created_by")+ actions = ("make_enabled", "make_disabled")++ # Toggling `enabled` drives the duckling sensors into expensive ClickHouse->S3+ # backfills, so it goes through Django's action-confirmation flow rather than an+ # inline `list_editable` checkbox that can be flipped for the wrong team in passing.+ @admin.action(description="Enable warehouse backfills for selected teams")+ def make_enabled(self, request: HttpRequest, queryset: QuerySet[DuckLakeBackfill]) -> None:+ updated = queryset.update(enabled=True)+ self.message_user(request, f"Enabled warehouse backfills for {updated} team(s).")++ @admin.action(description="Disable warehouse backfills for selected teams")+ def make_disabled(self, request: HttpRequest, queryset: QuerySet[DuckLakeBackfill]) -> None:+ updated = queryset.update(enabled=False)+ self.message_user(request, f"Disabled warehouse backfills for {updated} team(s).")++ fieldsets = (+ (+ None,+ {+ "fields": ("id", "team", "enabled"),+ },+ ),+ (+ "Metadata",+ {+ "fields": ("created_by", "created_at", "updated_at"),+ },+ ),+ )