Am 08.02.2012 12:10, schrieb Alessandro Molina:
> Now it should be possible to use all the three options:
>   - Do not pass doctype to tg.render.render mean automatic detection
>   - Set it to None to enforce no doctype
>   - Set it to any string to force it if available for that content_type

Ok, I'll add tests for all these use cases.

We still have to clarify what takes precedence, templating.genshi.doctype (which was set excplicitly, but as a static value) or the doctype derived from response.content_type via doctypes_for_content_type.

Also, maybe we should allow templating.genshi.doctype to be a dict in which case doctypes_for_content_type would be updated by that dict. Same for templating.genshi.method and methods_for_content_type.

We could then let templating.genshi.doctype take precedence (as we currently do), but we shouldn't set in the quickstart templates any more so that the default automatic detection is active.

Does that make sense?

> It still doesn't solve in any way the issue of alex as there is still
> no way to enforce a doctype from the expose decorator or from the
> controller method. Adding text/xml to doctypes_for_content_type with
> None provides a fix for XML target output, but we should think if we
> want a more general way or if it is enough as genshi is actually able
> to render only a known set of documents when used in xml mode.

I would not add None values to doctypes_for_content_type but assume the doctype value is None for all content types not contained in the dict.

If you want to render a special doctype I think you can always include that verbatim in the template and set doctype=None when rendering.

-- Christoph

--
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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?hl=en.

Reply via email to