# Path: riv/serializers/base_serializer.py
# SEPARATOR = '__'
# class LoadingError(Exception):
# class Serializer(python.Serializer):
# class Loader:
#     def get_loader(self):
#     def serialize(self, queryset, **options):
#     def fake_serialize(self, queryset, **options):
#     def start_serialization(self):
#     def start_object(self, obj):
#     def end_object(self, obj):
#     def end_serialization(self):
#     def handle_fk_field(self, obj, field):
#     def handle_m2m_field(self, obj, field):
#     def serialize_reverse_fields(self, obj):
#     def _get_serialize_options_for_subfield(self, name):
#     def _map_field(self, key, value):
# def Deserializer(object_list, **options):
#     def load(self, queryset, **options):
#     def pre_loading(self):
#     def post_loading(self):
#     def get_querydict(self, force_batch=False):
#     def get_objects(self):
#     def dictionize_list_for_formsets(self):
#     def remove_excluded_fields(self):
#     def reverse_map_fields(self, objects=None):
#     def rearrange_for_deserialization(self):


from StringIO import StringIO
from django.conf import settings
from django.utils.encoding import smart_str
from django.core.serializers.base import DeserializationError
from django.utils.xmlutils import SimplerXMLGenerator
from xml.dom.minidom import parse
from riv.serializers import base_serializer as base
            if not name:
                name = 'object'
        for object in l:
            self.xml.startElement(name, {})
            if isinstance(object, dict):
                self.handle_dict(object)
            else:
                self.xml.characters(smart_str(object))
            self.xml.endElement(name)

    def getvalue(self):
        if callable(getattr(self.stream, 'getvalue', None)):
            return self.stream.getvalue()

    def _get_xml_name(self, obj):
        if isinstance(obj, dict) and obj.has_key('xml_verbose_name'):
            return obj.pop('xml_verbose_name')
        return 'object'

class Loader(base.Loader):
    def pre_loading(self):
        if isinstance(self.data, basestring):
            stream = StringIO(self.data)
        else:
            stream = self.data

        try:
            dom = parse(stream)
            self.objects = self._dom_to_python(dom)
        except Exception, e:

# Path: riv/serializers/base_serializer.py
# SEPARATOR = '__'
# class LoadingError(Exception):
# class Serializer(python.Serializer):
# class Loader:
#     def get_loader(self):
#     def serialize(self, queryset, **options):
#     def fake_serialize(self, queryset, **options):
#     def start_serialization(self):
#     def start_object(self, obj):
#     def end_object(self, obj):
#     def end_serialization(self):
#     def handle_fk_field(self, obj, field):
#     def handle_m2m_field(self, obj, field):
#     def serialize_reverse_fields(self, obj):
#     def _get_serialize_options_for_subfield(self, name):
#     def _map_field(self, key, value):
# def Deserializer(object_list, **options):
#     def load(self, queryset, **options):
#     def pre_loading(self):
#     def post_loading(self):
#     def get_querydict(self, force_batch=False):
#     def get_objects(self):
#     def dictionize_list_for_formsets(self):
#     def remove_excluded_fields(self):
#     def reverse_map_fields(self, objects=None):
#     def rearrange_for_deserialization(self):


# Path: riv/serializers/xml_serializer.py
from StringIO import StringIO
from django.conf import settings
from django.utils.encoding import smart_str
from django.core.serializers.base import DeserializationError
from django.utils.xmlutils import SimplerXMLGenerator
from xml.dom.minidom import parse
from riv.serializers import base_serializer as base

            if not name:
                name = 'object'
        for object in l:
            self.xml.startElement(name, {})
            if isinstance(object, dict):
                self.handle_dict(object)
            else:
                self.xml.characters(smart_str(object))
            self.xml.endElement(name)

    def getvalue(self):
        if callable(getattr(self.stream, 'getvalue', None)):
            return self.stream.getvalue()

    def _get_xml_name(self, obj):
        if isinstance(obj, dict) and obj.has_key('xml_verbose_name'):
            return obj.pop('xml_verbose_name')
        return 'object'

class Loader(base.Loader):
    def pre_loading(self):
        if isinstance(self.data, basestring):
            stream = StringIO(self.data)
        else:
            stream = self.data

        try:
            dom = parse(stream)
            self.objects = self._dom_to_python(dom)
        except Exception, e:

            raise base.LoadingError(e)