> Exactly what I do. Also you can have the URL "/news/" distinguish
> between GET and POST. If it's a GET, show the list of objects, if it's a
> POST, a new object is created.

How does one do this with TG?

> Handling all this in a "default" controller method is a bit messy, it
> would be nice to have an expose decorator that can distinguish between
> different HTTP methods like it is discussed for TG 2.0 at the moment (or
> was it 1.1.?).

What I came up with today seems to work ok. I made subcontrollers for
the resource, each of which inherits from CrudController and they set a
member field, self.resource, accordingly. That way in my main admin
controller I can just say

news = CrudController( resource=news ) 

or 

news = NewsAdminController() 
where NewsAdminController explictly inherits from CrudController and
sets the resource member field.

The point being that the convoluted default method only has to be done
once, in CrudController, and can just be inherited in the rest. Does
that seems sensible? If someones sees glaring disadvantages to the above
I'd be interested in hearing them!

Iain
> 


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

Reply via email to