django-faker
django-faker copied to clipboard
'Generator' object has no attribute 'randomInt'
Tried to use with a Python 3.4 project. Failed when tried to call Faker.getPopulator().
Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 00:54:21)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django_faker import Faker
>>> populator = Faker.getPopulator()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Users/JohnnyLee/Projects/carcajou/lib/python3.4/site-packages/django_faker/__init__.py", line 90, in getPopulator
generator = cls.generators.get(codename, None) or cls.getGenerator(codename=codename)
File "/Users/JohnnyLee/Projects/carcajou/lib/python3.4/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'
@jleeothon
I get the same error on Python 2.7.5, but had success installing from master:
pip uninstall django-faker
pip install git+git://github.com/joke2k/django-faker.git
@joke2k would you please releasing a new fix to pypi. Thanks.
This is because the faker library itself has changed its API. It doesn't look like @joke2k is maintaining this package anymore. I've started my own fork To try to fix these issues and also support Python 3 and Django 1.8.