joke2k / django-faker

Django-faker uses fake-factory to generate test data for Django models and templates
MIT License
245 stars 48 forks source link

Faker.getPopulator() raising an AttributeError #9

Closed joshainglis closed 10 years ago

joshainglis commented 10 years ago

Hi, I've just installed django-faker and upon first attempt, this occurred:

>>> from django_faker import Faker
>>> populator = Faker.getPopulator()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/vagrant/.virtualenvs/sadb/local/lib/python2.7/site-packages/django_faker/__init__.py", line 90, in getPopulator
    generator = cls.generators.get(codename,  None) or cls.getGenerator(codename=codename)
  File "/home/vagrant/.virtualenvs/sadb/local/lib/python2.7/site-packages/django_faker/__init__.py", line 58, in getGenerator
    cls.generators[codename].seed( cls.generators[codename].randomInt() )
AttributeError: 'Generator' object has no attribute 'randomInt'
BrendanBerkley commented 10 years ago

Just installed today and I got the same error.

>>> from django_faker import Faker
>>> populator = Faker.getPopulator()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/django_faker/__init__.py", line 90, in getPopulator
    generator = cls.generators.get(codename,  None) or cls.getGenerator(codename=codename)
  File "/usr/local/lib/python2.7/dist-packages/django_faker/__init__.py", line 58, in getGenerator
    cls.generators[codename].seed( cls.generators[codename].randomInt() )
AttributeError: 'Generator' object has no attribute 'randomInt'
joke2k commented 10 years ago

you have to reinstall fake-factory dependency. type:

pip uninstall django-faker
pip uninstall fake-factory

then

pip install django-faker

and retry to import populator.

joke2k commented 10 years ago

try to reinstall with pip install git+git://github.com/joke2k/django-faker.git

BrendanBerkley commented 10 years ago

Had to do the git link. Thanks!

show0k commented 10 years ago

Hi, I've the same bug installed from pip. Name: django-faker Version: 0.2 unsing fake-factory-0.4.0

But it works from the git link. Is it possible to fix it on Pypi ? Thanks

edwinlunando commented 9 years ago

Hi, I got this errors too. Do you mind releasing a new fix to pypi? Thanks

sametmax commented 8 years ago

+1