MVC in Google App Engine

3 views
Skip to first unread message

Gene Conroy-Jones

unread,
Apr 20, 2008, 3:23:17 PM4/20/08
to Google App Engine
Hi,

I am trying to implement an MVC design to my google app engine project
and wanted to pass the information by the community to see what they
thought.

GUIDELINES
app. yaml: use handlers to determine which entity to load.
Main Entry point to each entity: $/MVC/<entity name>/main.py
Data Models for entity: $/MVC/<entity name>/model.py
Templates for entity: $/MVC/<entity name>/<File name>.html

EXAMPLE
For instance if I create an entity called "Profile" I would add a
handler to app.yaml like this to manage all requests from http://<website
root name>/Profile/*

handlers:
- url: /Profile/.*
script: /MVC/Profile/main.py


What does everyone think? Alternatively I could use main.py in the
root to determine which MVC entity model to load and that would not
require an addition to app.yaml each time a new entity is created, but
it is nice to have full control over what is handled.

Any suggestions / collaborations get in touch.

Regards
Gene


Miguel Sanchez

unread,
Apr 20, 2008, 5:14:52 PM4/20/08
to Google App Engine
Hi drthink,

i have done some test with REST controllers like rails. You can see it
here:
http://groups.google.com/group/google-appengine/browse_thread/thread/4f1ca14a091b06ee

I want to extend the class webapp.RequestHandler with this stuff and
create a REST controller, so you only have to define this methods and
don't care about routes.

Miguel.

Cameron Singe

unread,
Apr 20, 2008, 6:39:51 PM4/20/08
to Google App Engine
Why reinvent the wheel?, django url routes are dead simple and work
very similar to how your explaining

On Apr 21, 6:14 am, Miguel Sanchez <migue...@gmail.com> wrote:
> Hi drthink,
>
> i have done some test with REST controllers like rails. You can see it
> here:http://groups.google.com/group/google-appengine/browse_thread/thread/...

Aaron Krill

unread,
Apr 21, 2008, 12:32:45 AM4/21/08
to google-a...@googlegroups.com
reinventing wheels is fun? :-p

Ian Bicking

unread,
Apr 21, 2008, 1:14:56 AM4/21/08
to google-a...@googlegroups.com
Miguel Sanchez wrote:
> Hi drthink,
>
> i have done some test with REST controllers like rails. You can see it
> here:
> http://groups.google.com/group/google-appengine/browse_thread/thread/4f1ca14a091b06ee
>
> I want to extend the class webapp.RequestHandler with this stuff and
> create a REST controller, so you only have to define this methods and
> don't care about routes.

It would also be possible to use Routes. I have some scrappy code using
Routes without Pylons here:
http://svn.colorstudy.com/home/ianb/PickyWiki/trunk/pickywiki/routing.py
-- it might be useful to someone playing around with this stuff.

--
Ian Bicking : ia...@colorstudy.com : http://blog.ianbicking.org

Miguel Sanchez

unread,
Apr 21, 2008, 2:33:15 AM4/21/08
to Google App Engine
I dont' want to reinvent the wheel yet. I want to learn python
first ;)

Brett Morgan

unread,
Apr 21, 2008, 2:50:10 AM4/21/08
to google-a...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages