Skip to content

Passing kwargs to related models #55

Description

@sobolevn

Imagine that we have a model like so:

class User(models.Model):
     profile = models.ForeignKey('UserProfile') 
     is_active = models.BooleanField()

And later I want to use it like so:

active_user_factory = fakery.blueprint(User).fields(
    is_active=True,
)

empty_username = active_user_factory.m(profile__username='')
email_username = active_user_factory.m(profile__username='email@example.com')

But, currently this does not work. What can be done to pass kwargs to related objects?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions