From c20d3201ab0659f4797a0ad6176610e6f2f5f4f7 Mon Sep 17 00:00:00 2001 From: cmekeirl Date: Fri, 3 May 2024 12:43:39 +0200 Subject: [PATCH] titles now in txt file --- backend/seeder/elements.py | 211 ------------------------------------- backend/seeder/seeder.py | 13 ++- backend/seeder/titles.txt | 208 ++++++++++++++++++++++++++++++++++++ 3 files changed, 219 insertions(+), 213 deletions(-) delete mode 100644 backend/seeder/elements.py create mode 100644 backend/seeder/titles.txt diff --git a/backend/seeder/elements.py b/backend/seeder/elements.py deleted file mode 100644 index badf0a74..00000000 --- a/backend/seeder/elements.py +++ /dev/null @@ -1,211 +0,0 @@ -"""Some valid course names for the course_titles provider""" -course_titles = [ - "Computer Science", - "Principles of Economics", - "Modern Literature", - "Organic Chemistry", - "World History", - "Calculus and Analytic Geometry", - "Psychology", - "Microbiology Fundamentals", - "Principles of Marketing", - "Environmental Science", - "Sociology", - "Financial Accounting", - "Political Science and Government", - "Human Anatomy", - "Business Ethics", - "Philosophy", - "Statistics for Social Sciences", - "Cell Biology", - "Anthropology", - "Principles of Management", - "Macroeconomics", - "General Physics", - "English Composition", - "Human Physiology", - "Developmental Psychology", - "Linguistics", - "Genetics and Genomics", - "Principles of Finance", - "Art History", - "Microeconomics", - "Anatomy and Physiology", - "Marketing", - "Astronomy", - "Political Science", - "Microeconomics", - "Business", - "Cultural Anthropology", - "American History", - "World Religions", - "Chemistry", - "Environmental Science", - "Communication", - "General Chemistry", - "Cultural Anthropology", - "Human Biology", - "Theatre", - "Public Speaking", - "International Relations", - "Sociology", - "Criminal Justice", - "Statistics", - "Human Anatomy", - "Western Civilization", - "Literature", - "Biochemistry", - "Physical Anthropology", - "Human Physiology", - "Creative Writing", - "Film Studies", - "Music", - "Ethics", - "Philosophy of Science", - "Philosophy of Mind", - "Philosophy of Language", - "Political Philosophy", - "Philosophy of Religion", - "Epistemology", - "Metaphysics", - "Logic", - "Symbolic Logic", - "Modal Logic", - "Mathematical Logic", - "Computer Science", - "Programming", - "Algorithms", - "Data Structures", - "Software Engineering", - "Computer Networks", - "Operating Systems", - "Database Systems", - "Artificial Intelligence", - "Machine Learning", - "Computer Vision", - "Natural Language Processing", - "Robotics", - "Human-Computer Interaction", - "Virtual Reality", - "Augmented Reality", - "Web Development", - "Mobile Development", - "Development", - "Cybersecurity", - "Cryptography", - "Digital Forensics", - "Cloud Computing", - "Big Data", - "Data Science", - "Data Analytics", - "Data Visualization", - "Business Intelligence", - "Information Systems", - "E-commerce", - "Web Design", - "User Experience Design", - "User Interface Design", - "Graphic Design", - "Multimedia Design", - "Animation", - "Digital Art", - "Photography", - "Videography", - "Audio Production", - "Sound Design", - "Music Production", - "Film Production", - "Screenwriting", - "Directing", - "Cinematography", - "Film Editing", - "Visual Effects", - "Motion Graphics", - "3D Modeling", - "3D Animation", - "Design", - "Programming", - "Art", - "Sound", - "Narrative", - "Testing", - "Marketing", - "Publishing", - "Monetization", - "Analytics", - "Localization", - "Development Tools", - "Engines", - "AI", - "Networking", - "Servers", - "Security", - "Design Patterns", - "Theory", - "History", - "Culture", - "Studies", - "Journalism", - "Criticism", - "Law", - "Ethics", - "Philosophy", - "Psychology", - "Sociology", - "Anthropology", - "Archaeology", - "Economics", - "Marketing", - "Management", - "Development Methodologies", - "Production", - "Design Documents", - "Prototyping", - "Testing", - "Quality Assurance", - "Localization", - "Voice Acting", - "Music Composition", - "Sound Design", - "Art Direction", - "Animation", - "Character Design", - "Environment Design", - "Level Design", - "Storytelling", - "Writing", - "Dialogue", - "Cutscenes", - "Worldbuilding", - "Concept Art", - "Production Design", - "User Interface Design", - "User Experience Design", - "Interaction Design", - "Control Design", - "Camera Design", - "Interface Design", - "HUD Design", - "Menu Design", - "Navigation Design", - "Inventory Design", - "Map Design", - "Mini-map Design", - "Tutorial Design", - "Help System Design", - "Accessibility Design", - "Reward System Design", - "Progression System Design", - "Achievement System Design", - "Leaderboard Design", - "Social System Design", - "Community System Design", - "Feedback System Design", - "Chat System Design", - "Messaging System Design", - "Notification System Design", - "Ranking System Design", - "Matchmaking System Design", - "Voting System Design", - "Auction System Design", -] diff --git a/backend/seeder/seeder.py b/backend/seeder/seeder.py index f4f29ff3..20b320c0 100644 --- a/backend/seeder/seeder.py +++ b/backend/seeder/seeder.py @@ -11,7 +11,6 @@ from sqlalchemy.exc import SQLAlchemyError from sqlalchemy_utils import register_composites -from elements import course_titles from project.models.course import Course from project.models.course_relation import CourseAdmin, CourseStudent from project.models.project import Project @@ -25,9 +24,19 @@ fake = Faker() +# Get the directory of the current script +script_dir = os.path.dirname(os.path.realpath(__file__)) + +# Construct the path to titles.txt relative to the script directory +titles_path = os.path.join(script_dir, 'titles.txt') + +with open(titles_path, 'r', encoding='utf-8') as file: + # Read the lines of the file and strip newline characters + titles = [line.strip() for line in file] + course_title_provider = DynamicProvider( # Custom course titles. provider_name="course_titles", - elements=course_titles, + elements=titles, ) fake.add_provider(course_title_provider) diff --git a/backend/seeder/titles.txt b/backend/seeder/titles.txt new file mode 100644 index 00000000..cd5a42ca --- /dev/null +++ b/backend/seeder/titles.txt @@ -0,0 +1,208 @@ +Computer Science +Principles of Economics +Modern Literature +Organic Chemistry +World History +Calculus and Analytic Geometry +Psychology +Microbiology Fundamentals +Principles of Marketing +Environmental Science +Sociology +Financial Accounting +Political Science and Government +Human Anatomy +Business Ethics +Philosophy +Statistics for Social Sciences +Cell Biology +Anthropology +Principles of Management +Macroeconomics +General Physics +English Composition +Human Physiology +Developmental Psychology +Linguistics +Genetics and Genomics +Principles of Finance +Art History +Microeconomics +Anatomy and Physiology +Marketing +Astronomy +Political Science +Microeconomics +Business +Cultural Anthropology +American History +World Religions +Chemistry +Environmental Science +Communication +General Chemistry +Cultural Anthropology +Human Biology +Theatre +Public Speaking +International Relations +Sociology +Criminal Justice +Statistics +Human Anatomy +Western Civilization +Literature +Biochemistry +Physical Anthropology +Human Physiology +Creative Writing +Film Studies +Music +Ethics +Philosophy of Science +Philosophy of Mind +Philosophy of Language +Political Philosophy +Philosophy of Religion +Epistemology +Metaphysics +Logic +Symbolic Logic +Modal Logic +Mathematical Logic +Computer Science +Programming +Algorithms +Data Structures +Software Engineering +Computer Networks +Operating Systems +Database Systems +Artificial Intelligence +Machine Learning +Computer Vision +Natural Language Processing +Robotics +Human-Computer Interaction +Virtual Reality +Augmented Reality +Web Development +Mobile Development +Development +Cybersecurity +Cryptography +Digital Forensics +Cloud Computing +Big Data +Data Science +Data Analytics +Data Visualization +Business Intelligence +Information Systems +E-commerce +Web Design +User Experience Design +User Interface Design +Graphic Design +Multimedia Design +Animation +Digital Art +Photography +Videography +Audio Production +Sound Design +Music Production +Film Production +Screenwriting +Directing +Cinematography +Film Editing +Visual Effects +Motion Graphics +3D Modeling +3D Animation +Design +Programming +Art +Sound +Narrative +Testing +Marketing +Publishing +Monetization +Analytics +Localization +Development Tools +Engines +AI +Networking +Servers +Security +Design Patterns +Theory +History +Culture +Studies +Journalism +Criticism +Law +Ethics +Philosophy +Psychology +Sociology +Anthropology +Archaeology +Economics +Marketing +Management +Development Methodologies +Production +Design Documents +Prototyping +Testing +Quality Assurance +Localization +Voice Acting +Music Composition +Sound Design +Art Direction +Animation +Character Design +Environment Design +Level Design +Storytelling +Writing +Dialogue +Cutscenes +Worldbuilding +Concept Art +Production Design +User Interface Design +User Experience Design +Interaction Design +Control Design +Camera Design +Interface Design +HUD Design +Menu Design +Navigation Design +Inventory Design +Map Design +Mini-map Design +Tutorial Design +Help System Design +Accessibility Design +Reward System Design +Progression System Design +Achievement System Design +Leaderboard Design +Social System Design +Community System Design +Feedback System Design +Chat System Design +Messaging System Design +Notification System Design +Ranking System Design +Matchmaking System Design +Voting System Design +Auction System Design \ No newline at end of file