On Jul 1, 1:48 am, Mike Orr <[email protected]> wrote:
> On Tue, Jun 30, 2009 at 8:52 PM, Jon<[email protected]> wrote:
>
> > I've been having some issues with Routes and some problems in the
> > documentation and on the web pages for routes are not making things
> > any easier.
>
> > First, the version on the routes web page is 1.3.2, released in 2006.
>
> > However, that wasn't the issue I was experiencing, although I found it
> > odd that the download page did not include a link to pypi.
>
> > The bigger issue was due to some issues with the documentation.
>
> > The first issue I had took me a while to figure out. Ultimately, I was
> > experimenting with using .resource and having very little luck. The
> > reasons why are listed below:
>
> > 1. According tohttp://routes.groovie.org/integration.htmlall I
> > really need to do is set up a Mapper, call create_regs, and then I'm
> > free to use routematch.  This isn't true, really, as the environ is
> > necessary for things like the method. I assumed, perhaps, that if the
> > method wasn't present that it would default to GET, as it routematch
> > did not return an error but it also didn't return what I expected when
> > I started using the documented approach, which leads me to my second
> > issue:
>
> > 2. The documentation in two places needs fixing. The first is in the
> > Manual for how to use .resource. The variable used switches from
> > 'm' (used in other places) to 'map' (a reserved word). The second is
> > that the examples for .resource are wrong.  No longer are semicolons
> > used, which is weird, as they are allowed by the HTTP and URL RFCs. I
> > did, of course, check the group and saw the forwarding problem, but
> > honestly the semicolon variant appears nicer and is somewhat more
> > correct. (/path/to/object/edit is not a resource, it is a view. /path/
> > to/object;edit is a view *of* object) but that train has already left.
> > Therefore, let me please suggest that the docs get these minor
> > cleanups, and the download page include an up-to-date version for
> > Routes, and a link to pypi.
>
> There's a newer manual athttp://sluggo.scrapping.cc/python/routes-manual.html
> It will be integrated as soon as I have time to figure out how to
> integrate it into the new Sphinx documentation system and Pylons site.
>
> I'm not sure what you're asking in (1), but Routes works hand in hand
> with the RoutesMiddleware.  I would follow what the middleware does to
> see the proper usage.  Also, minimization and implicit defaults are
> disabled by default now, and pylons.url does not use route memory
> unless you call url.current().  This may affect which route gets
> chosen vs what you were expecting.  Routes does not look at the
> request method as far as I know, so I'm not sure what you mean there.

The documentation at http://routes.groovie.org/integration.html makes
no mention of RoutesMiddleware (which is indeed what I ended up going
with), but instead states some things which are either out of date or
wrong. Perhaps it should either be removed or cleaned up to make use
of RoutesMiddleware.  The simplest possible use of Route might go like
this:

import routes
import routes.middleware

m = routes.Maper()
m.create_regs([ 'controller1', 'controller2', 'controller3' ])
app = routes.middleware.RoutesMiddleware(some_wsgi_app, m)

....

> As for (2), hopefully the syntax inconsistencies have been cleared up.
>  The ";edit" syntax was changed to "/" because ";" is not allowed in
> URL paths, as we discovered later.  Semicolons delimit key=value pairs
> in the route path (distinct from the query string), a feature which is
> rarely used but exists.  In this we followed the Rails version of
> Routes, which made the same change.

Semicolons surely are allowed, but sometimes they cause problems with
badly behaved software. That's not really the same thing as
disallowed. Regardless of *why* the change was made, however, the
documentation is referring to the old way and not the new way. The new
documentation has the correct syntax.

Thanks for the reply!

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

Reply via email to