web/views/xmlrss.py
branchstable
changeset 4994 108bb7f2a171
parent 4898 5dec0d400d08
child 5421 8167de96c523
equal deleted inserted replaced
4993:c9229f185690 4994:108bb7f2a171
    48         """ element as an item for an xml feed """
    48         """ element as an item for an xml feed """
    49         entity = self.cw_rset.complete_entity(row, col)
    49         entity = self.cw_rset.complete_entity(row, col)
    50         self.w(u'<%s>\n' % (entity.e_schema))
    50         self.w(u'<%s>\n' % (entity.e_schema))
    51         for rschema, attrschema in entity.e_schema.attribute_definitions():
    51         for rschema, attrschema in entity.e_schema.attribute_definitions():
    52             attr = rschema.type
    52             attr = rschema.type
    53             try:
    53             if attr == 'eid':
    54                 value = entity[attr]
    54                 value = entity.eid
    55             except KeyError:
    55             else:
    56                 # Bytes
    56                 try:
    57                 continue
    57                     value = entity[attr]
       
    58                 except KeyError:
       
    59                     # Bytes
       
    60                     continue
    58             if value is not None:
    61             if value is not None:
    59                 if attrschema == 'Bytes':
    62                 if attrschema == 'Bytes':
    60                     from base64 import b64encode
    63                     from base64 import b64encode
    61                     value = '<![CDATA[%s]]>' % b64encode(value.getvalue())
    64                     value = '<![CDATA[%s]]>' % b64encode(value.getvalue())
    62                 elif isinstance(value, basestring):
    65                 elif isinstance(value, basestring):