Matt Wilson schrieb:
> content_format = content_format.split()[0].split('-' , 1)[0]
> AttributeError: 'HTMLSerializer' object has no attribute 'split'
The problem seems to be that you set your kid.format not to as 'html'
but as a HTMLSerializer object, which is actually possible, but the
problem is that TG 1.0.5 tries to derive the content type from the
format and fails here if the format is not a string.
Workarounds:
1) Use a string instead of the HTMLSerializer, e.g.
'html' instead of HTMLSerializer(doctype='html') or
'html-quirks' instead of HTMLSerializer(doctype='html-quirks')
2) Explicitly set the content_type in the expose decorator,
so the content type doesn't need to be derived from the format
3) Apply the patch in r4885.
A better solution than patch r4885 would also handle the cases where
format is XTMLSerializer, XMLSerializer or PlainSerializer and derive
the proper content type. Maybe TurboKid (and other engines) should
provide an auxiliary function for deriving a proper content type from
the format parameter? (TurboJson provided a similar function for
deriving the content type from the user agent).
-- Christoph
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---