Closed frankrousseau closed 7 years ago
I solved my problem by forcing the generator each time I generate objects:
import uuid
mixer.blend(Car, id=uuid.uuid4)
I came to the following solution to use PostgreSQL UUIDs:
from sqlalchemy.dialects import postgresql as pg
from mixer.backend.sqlalchemy import Mixer, GenFactory
from mixer import mix_types
class MyFactory(GenFactory):
types = dict(GenFactory.types)
types[pg.UUID] = mix_types.UUID
mixer = Mixer(factory=MyFactory)
Hello there,
Thank you for mixer, it is a very useful tool. I use it to test an API based on Flask Restful and Postgres. But I face an issue. When I want to use a UUIDType column in my database schema, it is not recognized and Mixer can't give a value to it (this type comes from SQLAlchemy utils).
I tried this solution:
But it doesn't work. Do you have any idea about what to do to make it work?