Yeah.


On Tue, Jul 30, 2013 at 1:16 PM, Peter Fogg <notifications@github.com>wrote:

> In common/lib/xmodule/xmodule/raw_module.py:
>
> > +
> > +class EmptyDataRawDescriptor(XmlDescriptor, XMLEditingDescriptor):
> > +    """
> > +    Version of RawDescriptor for modules which may have no XML data,
> > +    but use XMLEditingDescriptor for import/export handling.
> > +    """
> > +    data = String(default='', scope=Scope.content)
> > +
> > +    @classmethod
> > +    def definition_from_xml(cls, xml_object, system):
> > +        if len(xml_object) == 0 and len(xml_object.items()) == 0:
> > +            return {'data': ''}, []
> > +        return {'data': etree.tostring(xml_object, pretty_print=True, encoding='unicode')}, []
> > +
> > +    def definition_to_xml(self, resource_fs):
> > +        return etree.Element(self.category)
>
> So we should check if data is empty, return the empty tag if so, and read
> in the XML otherwise?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/edx/edx-platform/pull/492/files#r5482617>
> .
>