sarrionandia / tournatrack

Debate tournament tracker for convenors
Apache License 2.0
2 stars 2 forks source link

Consolidate routes into a single wsgi handler #48

Open blwy10 opened 10 years ago

blwy10 commented 10 years ago

This is a bit nitpicky, and it's certainly not crucial, but I was wondering if it might be better to consolidate all the routing information into a single wsgi handler, instead of listing all of it in the app.yaml config?

What I mean is that currently a wsgi app handler is created in each Python file corresponding to a route in the app.yaml config. Instead, have all routes (via a match all regex) point to a single Python file, and in this Python file a single app object is created that has all the specific routes. Otherwise, the existing code structure/file separation of views is the same.

Sorry if this is unclear, I don't do nearly enough programming to be able to eloquently express myself.

Even with this issue though, this is a great piece of work. Thanks Tito!

sarrionandia commented 10 years ago

I'm in the process of merging some of them (for example, all of the deregistration handlers) -- but is there some specific reason why you'd want to merge all of them?

blwy10 commented 10 years ago

Just conceptual neatness - my understanding of the wsgi standard is that a single "application" is defined by a single application handler. webapp2 implements that as a single application object via which you do routing.

The other reason is that you don't have to duplicate route names/url path elements in both the app.yaml and the app object for each view.

Beyond those reasons, there's no real engineering reason to change this. Admittedly, it's quite nitpicky.

sarrionandia commented 10 years ago

The duplication is getting a little messy. At some point I want to make the URLs more REST-y and that way I could just fire things at one of a few handlers based on what it is.

e.g. reg/* for reg/team reg/judge or reg/institution update/* etc.

I'm going to mark this long term