from . import admin, errors
from .article import ArticleDetailView, ArticleListView
from .base import BaseAPIView, BaseView
from .diffusion import DiffusionListView, TimeTableView
from .episode import EpisodeDetailView, EpisodeListView, PodcastListView, EpisodeUpdateView
from .home import HomeView
from .log import LogListAPIView, LogListView
from .page import (
    BasePageDetailView,
    BasePageListView,
    PageDetailView,
    PageListView,
    PageUpdateView,
)
from .profile import ProfileView
from .program import (
    ProgramDetailView,
    ProgramListView,
    ProgramPageDetailView,
    ProgramPageListView,
    ProgramUpdateView,
)


__all__ = (
    "admin",
    "errors",
    "BaseAPIView",
    "BaseView",
    "ArticleDetailView",
    "ArticleListView",
    "DiffusionListView",
    "TimeTableView",
    "EpisodeDetailView",
    "EpisodeListView",
    "PodcastListView",
    "EpisodeUpdateView",
    "HomeView",
    "LogListAPIView",
    "LogListView",
    "BasePageDetailView",
    "BasePageListView",
    "PageDetailView",
    "PageUpdateView",
    "PageListView",
    "ProfileView",
    "ProgramDetailView",
    "ProgramListView",
    "ProgramPageDetailView",
    "ProgramPageListView",
    "ProgramUpdateView",
    "attached",
)


attached = {}

for key in __all__:
    view = globals().get(key)
    if key == "attached":
        continue
    if attach := getattr(view, "attach_to_value", None):
        attached[attach] = view
