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

error: unrecognized arguments: --seeder #101

Open
timomeara opened this issue Jul 30, 2021 · 4 comments
Open

error: unrecognized arguments: --seeder #101

timomeara opened this issue Jul 30, 2021 · 4 comments

Comments

@timomeara
Copy link

timomeara commented Jul 30, 2021

"--seeder" arg not working in management command

this command:
./manage.py seed location --number=10 --seeder "Address.hours" "None"

gives me:
manage.py seed: error: unrecognized arguments: --seeder Address.hours {}

Django==3.2.4
Python 3.8.10

@Daveson217
Copy link

I have the same issue

@elebumm
Copy link

elebumm commented Sep 28, 2021

Having this issue as well.

@havocbane
Copy link
Contributor

havocbane commented Oct 2, 2021

I am only able to reproduce this error if I pass unknown arguments to the seed management command. It looks like the --seeder flag was added in version 0.3.0 here. I suspect that you are using an older version of the library than this. For example, if I pass the flag --does-not-exist, I get the same kind of message:

$ python manage.py seed seed_test --number=1 --does-not-exist "ToBeSeeded.foo" "None"
manage.py seed: error: unrecognized arguments: --does-not-exist ToBeSeeded.foo None

To kind of prove this to myself, I did a checkout of the previous version, 0.2.2, and was able to reproduce the error exactly:

$ git checkout 0.2.2
$ python manage.py seed seed_test --number=1 --seeder "ToBeSeeded.foo" "None"
manage.py seed: error: unrecognized arguments: --seeder ToBeSeeded.foo None

Note, however, that if I am using version 0.3.0, it works just fine:

$ git checkout 0.3.0
$ python manage.py seed seed_test --number=1 --seeder "ToBeSeeded.foo" "None"
Model ToBeSeeded generated record with primary key 58

Lastly, it looks like the latest version on pypi is 0.2.2, so it seems like we need the maintainer to upload the more recent version to address this issue before resolving.

@j-krl
Copy link

j-krl commented Jan 11, 2022

I'm having an issue where it just ignores my given fields. If I do

python manage.py seed users --number=1 --seeder "User.type" "client"

my db is populated with the default type argument, and not client.

However, if I run in the shell

In [1]: seeder.add_entity(User, 1, {'type': 'client'})
In [2]: seeder.execute()

It populates correctly. I think there's some error in the cli command.

I'm using 0.3.1

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

5 participants