'Complement to rendered_data.  Called when a dictionary of
thing data attributes is to be sent across the wire.'

def raw_data(self, thing):

    attrs = dict(self._data_attrs_)
    if hasattr(self, '_optional_data_attrs'):
        for (attr, attrv) in self._optional_data_attrs.iteritems():
            if hasattr(thing, attr):
                attrs[attr] = attrv
    return dict(((k, self.thing_attr(thing, v)) for (k, v) in attrs.iteritems()))
