Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to auto-generate data based on model spec #13

Closed
thibaudcolas opened this issue Feb 19, 2020 · 3 comments
Closed

Ability to auto-generate data based on model spec #13

thibaudcolas opened this issue Feb 19, 2020 · 3 comments
Labels
decision needed This requires a decision django Related to Django templates capabilities enhancement New feature or request storybook Usage of Storybook will affect this
Milestone

Comments

@thibaudcolas
Copy link
Member

In GitLab by @todd-dembrey on Jan 15, 2018, 12:14

Instead of specifying the data within a yaml file, have the ability to auto spec the data based on the model field definitions similar to how factory boy works.

A constant seed could be used as required to prevent rapidly changing text between refreshes. But the ability to generate long/short content for testing and visual validation would be useful.

Something like faker could be used to map field type -> default faker class and custom field definitions could also be used for properties etc.
https://github.com/joke2k/faker

@thibaudcolas
Copy link
Member Author

In GitLab by @bcdickinson on Jan 24, 2018, 16:01

I'm not sure about this, I think it's not really a pattern library's job to know anything about your database schema. I could definitely get behind some YAML tags for lorem ipsum and some of the common faker providers, though.

@thibaudcolas
Copy link
Member Author

@bcdickinson this feels related/similar to the discussion we had about writing stories in Python:

Investigate creating stories in Python, akin to unit tests (w/ DB awareness & factories)

@thibaudcolas thibaudcolas added storybook Usage of Storybook will affect this django Related to Django templates capabilities labels Feb 24, 2020
@thibaudcolas
Copy link
Member Author

Closing this in favour of #106.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
decision needed This requires a decision django Related to Django templates capabilities enhancement New feature or request storybook Usage of Storybook will affect this
Projects
No open projects
Development

No branches or pull requests

1 participant