<s> from . models import Blog , Post <EOL> from . views import browse , show_post , latest_entries_feed <EOL> from urlrouter . base import URLHandler <EOL> class BlogRoutes ( URLHandler ) : <EOL> model = Blog <EOL> def show ( self , request , blog ) : <EOL> if request . path == blog . get_internal_feed_url ( ) : <EOL> return latest_entries_feed ( request , blog ) <EOL> return browse ( request , blog = blog ) <EOL> def get_urls ( self , blog ) : <EOL> yield blog . get_absolute_url ( ) <EOL> yield blog . get_internal_feed_url ( ) <EOL> class BlogPostRoutes ( URLHandler ) : <EOL> model = Post <EOL> show = staticmethod ( show_post ) <EOL> def get_urls ( self , post ) : <EOL> if post . published : <EOL> yield post . get_absolute_url ( ) </s>
