File size: 1,747 Bytes
ab028ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python3
"""
Check all users and their profiles.
"""

from models import db, User, Introduction, WorkExperience, Project, Education, Skill, Achievement
from app import app

def check_all_profiles():
    """Check all users and their profile data."""
    
    with app.app_context():
        users = User.query.all()
        print(f"Total users: {len(users)}")
        
        for user in users:
            print(f"\nUser: {user.email} (ID: {user.id})")
            
            # Check introduction
            intro = Introduction.query.filter_by(user_id=user.id).first()
            print(f"  Has introduction: {'Yes' if intro else 'No'}")
            if intro:
                print(f"    Name: {intro.name}")
            
            # Check profile summary
            from models import ProfileSummary
            summary = ProfileSummary.query.filter_by(user_id=user.id).first()
            print(f"  Has profile summary: {'Yes' if summary else 'No'}")
            
            # Check other sections
            work_count = WorkExperience.query.filter_by(user_id=user.id).count()
            project_count = Project.query.filter_by(user_id=user.id).count()
            education_count = Education.query.filter_by(user_id=user.id).count()
            skill_count = Skill.query.filter_by(user_id=user.id).count()
            achievement_count = Achievement.query.filter_by(user_id=user.id).count()
            
            print(f"  Work experiences: {work_count}")
            print(f"  Projects: {project_count}")
            print(f"  Education: {education_count}")
            print(f"  Skills: {skill_count}")
            print(f"  Achievements: {achievement_count}")

if __name__ == "__main__":
    check_all_profiles()