"""
Base admin classes providing standardized behavior for all admin interfaces.

This module defines the foundational admin classes that should be used as base
classes for all model admin classes in the ThrillWiki application.
"""

from django.contrib import admin


class BaseModelAdmin(admin.ModelAdmin):
    """
    Base admin class with standardized settings for all model admins.

    Provides:
        - Consistent pagination (50 items per page)
        - Optimized result count behavior
        - Standard date hierarchy patterns
        - Consistent ordering
        - Empty value display standardization

    Usage:
        class MyModelAdmin(BaseModelAdmin):
            list_display = ['name', 'status', 'created_at']
            # ... additional configuration

    Attributes:
        list_per_page: Number of items to display per page (default: 50)
        show_full_result_count: Whether to show full count (default: False for performance)
        empty_value_display: String to display for empty values
        save_on_top: Show save buttons at top of change form
        preserve_filters: Preserve filters after saving
    """

    list_per_page = 50
    show_full_result_count = False
    empty_value_display = "-"
    save_on_top = True
    preserve_filters = True

    class Meta:
        abstract = True

    def get_queryset(self, request):
        """
        Get the base queryset with any model-specific optimizations.

        Override this method in subclasses to add select_related and
        prefetch_related calls for query optimization.

        Args:
            request: The HTTP request object

        Returns:
            QuerySet: The optimized queryset
        """
        return super().get_queryset(request)
