import glob from os.path import dirname, basename, isfile from flask import Blueprint from artists_moments.views.artists_moments_view import ( ProjectArtistsMomentsView, ArtistsMomentsTypesView, ArtistsMomentsCategoriesView, ArtistsMomentView, ) 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_moments", __name__) blueprint.add_url_rule( "/projects//artists-moments", view_func=ProjectArtistsMomentsView.as_view("artists_moments") ) blueprint.add_url_rule( "/projects//artists-moments/", view_func=ArtistsMomentView.as_view("artists_moment") ) blueprint.add_url_rule("/artists-moments/types", view_func=ArtistsMomentsTypesView.as_view("artist_moments_types")) blueprint.add_url_rule( "/artists-moments/categories", view_func=ArtistsMomentsCategoriesView.as_view("artist_moments_categories") )