|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
Generate Atom feed from tg?Heyho! For my tg 2 forum / blog type plaything: what's the best/easiest/recommended way to generate an Atom feed? The obvious way is writing a Genshi Atom template. Is this also what you'd recommend? Also: how do I change the template to be used from within a controller method? (Sure this is covered in the docs, but I haven't found it by a quick search, sorry.) cheers -- vbi -- featured link: Debian Bookmark Collection - http://bookmarks.debian.net/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to turbogears@... To unsubscribe from this group, send email to turbogears+unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Generate Atom feed from tg?> Also: how do I change the template to be used from within a controller > method? (Sure this is covered in the docs, but I haven't found it by a > quick search, sorry.) This has been discussed recently: http://groups.google.com/group/turbogears/browse_thread/thread/26af57fe95a617d5 HTH, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to turbogears@... To unsubscribe from this group, send email to turbogears+unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Generate Atom feed from tg?On Wednesday 14 October 2009 18:00:17 Adrian von Bidder wrote: > Heyho! > > For my tg 2 forum / blog type plaything: what's the > best/easiest/recommended way to generate an Atom feed? > > The obvious way is writing a Genshi Atom template. Is this also what you'd > recommend? We do it that way, yes. I think the hardest part is to format dates & know which date is used for what... the rest is pretty simple. > Also: how do I change the template to be used from within a controller > method? (Sure this is covered in the docs, but I haven't found it by a > quick search, sorry.) override_template Diez --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to turbogears@... To unsubscribe from this group, send email to turbogears+unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Generate Atom feed from tg?Diez B. Roggisch schrieb: > On Wednesday 14 October 2009 18:00:17 Adrian von Bidder wrote: >> The obvious way is writing a Genshi Atom template. Is this also what you'd >> recommend? > > We do it that way, yes. I think the hardest part is to format dates & know > which date is used for what... the rest is pretty simple. You could have a look at the Atom template from TurboFeeds: http://trac.turbogears.org/browser/projects/TurboFeeds/trunk/turbofeeds/templates Chris --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to turbogears@... To unsubscribe from this group, send email to turbogears+unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Generate Atom feed from tg?On Thursday 15 October 2009 13.58:11 Christopher Arndt wrote: > Diez B. Roggisch schrieb: > You could have a look at the Atom template from TurboFeeds: Cool, thanks a lot! cheers -- vbi -- Love may laugh at locksmiths, but he has a profound respect for money bags. -- Sidney Paternoster, "The Folly of the Wise" --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to turbogears@... To unsubscribe from this group, send email to turbogears+unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Generate Atom feed from tg?Adrian von Bidder wrote: > Heyho! > > For my tg 2 forum / blog type plaything: what's the best/easiest/recommended > way to generate an Atom feed? > > The obvious way is writing a Genshi Atom template. Is this also what you'd > recommend? > > Also: how do I change the template to be used from within a controller > method? (Sure this is covered in the docs, but I haven't found it by a > quick search, sorry.) > feeds in the various major formats. I actually sat down to document the "steal a genshi template from TurboFeeds" method into the documentation (and got most of the way down that path) before I found the WebHelpers documentation. You can find the current docs in the "third party modules" "webhelpers" section. I've updated the 2.1 docs to be a little less obtuse about this (i.e. to link it from the Working with TurboGears section and make the title describe what it lets you do). Here's the sample code from the updated docs: from helloworld.lib.base import BaseController from tg.controllers import CUSTOM_CONTENT_TYPE from webhelpers.feedgenerator import Atom1Feed from pylons import response from pylons.controllers.util import url_for class CommentsController(BaseController): @expose(content_type=CUSTOM_CONTENT_TYPE) def atom1( self ): """Produce an atom-1.0 feed via feedgenerator module""" feed = Atom1Feed( title=u"An excellent Sample Feed", link=url_for(), description=u"A sample feed, showing how to make and add entries", language=u"en", ) feed.add_item(title="Sample post", link=u"http://example.com/posts/sample", description="Testing.") response.content_type = 'application/atom+xml' return feed.writeString('utf-8') HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to turbogears@... To unsubscribe from this group, send email to turbogears+unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Generate Atom feed from tg?On Thursday 05 November 2009 05.59:35 Mike C. Fletcher wrote:
> The WebHelpers module provides a series of helper objects which generate > feeds in the various major formats. Much appreciated, thanks for the hint and the docs enhancements! I think this is the correct way forward as it certainly helps reducing code/feature duplication. Having (very similar / identical) genshi templates for Atom feeds being used by every tg user (and never updated/enhanced as the original version changes etc.) is not what FOSS is about... cheers -- vbi -- this email is protected by a digital signature: http://fortytwo.ch/gpg |
| Free embeddable forum powered by Nabble | Forum Help |