Hi Federico,

I'm not sure I see the problem. Obviously each handler you write is going to
be imported and mapped somewhere. If you want to minimize the size of your
handler script, you can have an __init__.py module in app.controllers that
imports all controllers. You can also create a custom metaclass for your
handlers that automatically registers them, if you wish.

-Nick Johnson

On Mon, Jul 27, 2009 at 7:54 PM, Federico Builes
<[email protected]>wrote:

>
> Hi,
>
> While working in not-so-big applications I'm seeing a lot of things
> like this:
>
> from app.controllers.most_voted import MostVoted
> from app.controllers.votes import Votes
> from app.controllers.comments import Comments
> from app.controllers.friends import Friends
> from app.controllers.photos import Photos
> from app.controllers.sponsors import Sponsors
> ...
>
> application = webapp.WSGIApplication([
>   ("sponsors", "Sponsors"),
>   ("photos", "Photos"),
>   ("friends", "Friends"),
>   ("comments", "Comments"),
>   ("votes", "Votes"),
>   ("most_voted", "MostVoted")
>   ...
>
> I can replace the initial imports with app.controllers.* and then do
> controllers.ControllerName but
> I still can't find a way to write concise routes.
>
> If you replace the "..." for 10 or 15 more controllers you'll start to
> see my point. I'm wondering
> what are the "best practices" in this area, what's people doing about
> this? I'd hate to see myself
> doing the same for bigger applications.
>
> --
> Federico
>
>
> >
>


-- 
Nick Johnson, Developer Programs Engineer, App Engine

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

Reply via email to