equal
deleted
inserted
replaced
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): |