Ticket #4187: __init__.py.diff

File __init__.py.diff, 861 bytes (added by sandro.turriate@…, 18 years ago)

fix python deserialization for manage.py loaddata

  • __init__.py

     
    7575    list_of_related_objects}``.
    7676    """
    7777    d = get_deserializer(format)
     78    if format == "python":
     79        data = stream_or_string.readline() #read the line
     80        stream_or_string = eval(data) #eval the line returning a python list of objects
    7881    return d(stream_or_string)
    7982
    8083def _load_serializers():
     
    8790        register_serializer(format, BUILTIN_SERIALIZERS[format])
    8891    if hasattr(settings, "SERIALIZATION_MODULES"):
    8992        for format in settings.SERIALIZATION_MODULES:
    90             register_serializer(format, settings.SERIALIZATION_MODULES[format])
    91  No newline at end of file
     93            register_serializer(format, settings.SERIALIZATION_MODULES[format])
Back to Top