import glob from os.path import dirname, basename, isfile from flask import Blueprint from artists.views.artist_roster_projects_view import ArtistRosterProjectsView from artists.views.artist_roster_view import ArtistRosterView from artists.views.artist_projects_export_view import ArtistProjectsExportView from artists.views.artist_unclaimed_projects_view import ArtistUnclaimedProjectsView from artists.views.artist_views import ArtistsView, ArtistView from artists.views.artist_projects_view import ArtistProjectsView from artists.views.artist_team_view import ArtistTeamView, ArtistTeamPerProjectsView from artists.views.label_artists_view import LabelArtistsView modules = glob.glob(dirname(__file__) + "/*.py") __all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith("__init__.py")] blueprint = Blueprint("artists", __name__) blueprint.add_url_rule("/artists", view_func=ArtistsView.as_view("artists")) blueprint.add_url_rule("/artists/", view_func=ArtistView.as_view("artist_view")) blueprint.add_url_rule( "/artists//projects", view_func=ArtistProjectsView.as_view("artist_projects_list") ) blueprint.add_url_rule( "/artists//unassigned-projects", view_func=ArtistUnclaimedProjectsView.as_view("unclaimed_artist_project_list"), ) blueprint.add_url_rule( "/artists//projects/export", view_func=ArtistProjectsExportView.as_view("artist_projects_export"), ) blueprint.add_url_rule( "/artists//artist-teams", view_func=ArtistTeamView.as_view("artist_team_per_artist") ) blueprint.add_url_rule( "/projects//artist-team", view_func=ArtistTeamPerProjectsView.as_view("artist_team_per_projects") ) blueprint.add_url_rule( "/artist-roster", view_func=ArtistRosterView.as_view("artist_roster_artists") ) blueprint.add_url_rule( "/artist-roster//projects", view_func=ArtistRosterProjectsView.as_view("artist_roster_projects") ) blueprint.add_url_rule( "/labels//artists", view_func=LabelArtistsView.as_view("label_artists") )