import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from app import create_app, db
from app.models.course import ShortCourse

app = create_app()

with app.app_context():
    count = ShortCourse.query.count()
    print(f"Number of short courses: {count}")
    if count > 0:
        courses = ShortCourse.query.all()
        print("\nExisting courses:")
        for course in courses:
            print(f"- {course.title}")