

def execute(self, using, insertedEntities):
    obj = self.model()
    for (field, format) in self.fieldFormatters.items():
        if format:
            value = (format(insertedEntities) if hasattr(format, '__call__') else format)
            setattr(obj, field, value)
    obj.save(using=using)
    return obj.pk

dataset/ETHPy150Open joke2k/django-faker/django_faker/populator.py ModelPopulator.execute/original