def convert_auto_field(field):
    connection = router.db_for_write(field.model)
    if settings.DATABASES[connection]['ENGINE'] in ('django_mongodb_engine',):
        # Check if AutoField is string for django-non-rel support
        return models.TextField
    return models.IntegerField
Convert AutoField to a non-incrementing type
dataset/ETHPy150Open treyhunner/django-simple-history/simple_history/models.py/convert_auto_field