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

TestData creating children #165

Closed
Jaymon opened this issue Jun 13, 2023 · 0 comments
Closed

TestData creating children #165

Jaymon opened this issue Jun 13, 2023 · 0 comments

Comments

@Jaymon
Copy link
Owner

Jaymon commented Jun 13, 2023

Let's say we've got this:

class Foo(Orm): pass

class Bar(Orm):
    foo_id = Field(Foo)

Could I make something like this work:

f = testdata.create_foo(bars_count=2)

for b in f.bars:
    ...

It would basically check the internal Orm list and see if anything matches .models_name and then make sure the match has a reference to Foo and then create however many count specified.

@Jaymon Jaymon closed this as completed in 82bde70 Jun 29, 2023
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

No branches or pull requests

1 participant