Skip to content

feat: use faker for realistic people data in create_random_data#728

Open
Pra26nav wants to merge 1 commit intowagtail:mainfrom
Pra26nav:feature/faker-people-v2
Open

feat: use faker for realistic people data in create_random_data#728
Pra26nav wants to merge 1 commit intowagtail:mainfrom
Pra26nav:feature/faker-people-v2

Conversation

@Pra26nav
Copy link
Copy Markdown
Contributor

Fixes #...
Related to #676

Description

This PR improves the create_random_data management command by replacing "lorem_ipsum" with "faker" for generating "Person" objects, and introduces a selected list of bakery-specific job titles.

Previously, people were created with "lorem_ipsum.words(1)" for names and job titles, producing unrealistic output like "lorem Baker" or "ipsum Manager". This change generates realistic first and last names via faker, paired with domain-appropriate job titles such as "Head Baker", "Pastry Chef", and "Sous Chef".

Changes

  1. Added "faker" to "requirements/base.txt"
  2. Replaced "lorem_ipsum" usage in the Person creation loop with "fake.first_name()" and "fake.last_name()"
  3. Introduced "BAKERY_JOB_TITLES", a selected list of bakery-specific roles replacing random lorem words for "job_title".

Testing

Tested locally by running:
python manage.py create_random_data 5 5 0
Verified via Django shell as people are getting created with realistic names and bakery job titles.

AI usage

Used Claude (claude.ai) for debugging help. The idea to combine faker with a selected list of bakery job titles came from reading the #676 discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant