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

Use seq with suffix str #93

Closed
diego-capyba opened this issue Jul 23, 2020 · 1 comment · Fixed by #111
Closed

Use seq with suffix str #93

diego-capyba opened this issue Jul 23, 2020 · 1 comment · Fixed by #111

Comments

@diego-capyba
Copy link

Is there anyway I can use seq to generate a string with some kind of suffix?

For example, I would like to generate emails as such:

user1@test.com, user2@test.com, ...

Is this possible somehow?

@berinhard
Copy link
Member

Unfortunately this is not possible yet but could be a nice thing to have =)

timjklein36 pushed a commit to timjklein36/model_bakery that referenced this issue Oct 2, 2020
- This adds a new `suffix` keyword arg to the `seq` function to allow
  the concatenation of a common suffix string onto a generated `seq`
  value.
- This adds a section under "Sequences in recipes" to the documentation
  to provide example usage of the new keyword argument.
  - Additionally, an `email` field is added to the `Customer` example
    model in the README.md to go along with the new section in the
    documentation.
- This also adds unit tests for the new keyword argument behavior.
timjklein36 pushed a commit to timjklein36/model_bakery that referenced this issue Oct 2, 2020
- This also adds that example field to the other `Customer`
  class examples throughout the docs.
timjklein36 pushed a commit to timjklein36/model_bakery that referenced this issue Oct 2, 2020
timjklein36 pushed a commit to timjklein36/model_bakery that referenced this issue Oct 2, 2020
… text sequence

- Also, change the str test case to use Person.email field (to better match
  the example mock data).
timjklein36 pushed a commit to timjklein36/model_bakery that referenced this issue Oct 2, 2020
- Removes unused variable in test method
timjklein36 pushed a commit to timjklein36/model_bakery that referenced this issue Oct 5, 2020
berinhard added a commit that referenced this issue Oct 6, 2020
* [#93] Add support for `suffix` in `seq`

- This adds a new `suffix` keyword arg to the `seq` function to allow
  the concatenation of a common suffix string onto a generated `seq`
  value.
- This adds a section under "Sequences in recipes" to the documentation
  to provide example usage of the new keyword argument.
  - Additionally, an `email` field is added to the `Customer` example
    model in the README.md to go along with the new section in the
    documentation.
- This also adds unit tests for the new keyword argument behavior.

* [#93] Change example email field to models.EmailField

- This also adds that example field to the other `Customer`
  class examples throughout the docs.

* [#93] Update CHANGELOG.md

* [#93] Raise TypeError if suffix is not text and used with text sequence

- Also, change the str test case to use Person.email field (to better match
  the example mock data).

* [#93] Fix lint issue

- Removes unused variable in test method

* [93] (CR) Change type checks to isinstance, add unit test

- Changes made based on code review suggestions

* [93] Remove unused variable from test

* [#93] Add docstring to `seq`

Co-authored-by: Bernardo Fontes <bernardoxhc@gmail.com>
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 a pull request may close this issue.

2 participants