On Oct 31, 1:44 pm, Alexandre Conrad <[email protected]>
wrote:
> When you create something, like a subsite, you really should want the
> client (browser, script, ...) to send a POST request. If you intend to
> create a new subsite with a GET with "/admin/subsite?site_id=1" as the
> path, how would you handle a user hitting multiple times the "reload"
> button? You'd create as many subsites as the number of times the
> reload button was hit and that's probably not what you want.

The situation here is that there is a list of 25 sites (paginated).
In order to use POST, each 'add site' button would be a form.  Adding
a site presents a 'new subsite' function that allows them to enter
some data before saving, so, a user reloading a page repeatedly isn't
going to create multiple sites.

> By the way, I realize that you said in your original mail that the
> controller is "admin" (AdminController). I think that's what might be
> your problem. You should have a controller per entity, such as "site"
> (SiteController) and "subsite" (SubsiteController). Each having all
> the necessary CRUD methods (Pylons actions) like "paster
> restcontroller subsite subsites" would create for you. You would then
> just need to add map.resource("site", "sites", path_prefix="/admin/")
> and map.resource("subsite", "subsites", path_prefix="/admin/") in
> routing.py. (I have never played with path_prefix kwarg, so you might
> want to double check how it behaves). This way you wouldn't need an
> AdminController at all if all you want to have is the prepending
> /admin/ path in your URL to make it pretty.

I'm leaning towards that.  Right now I've got 3 controllers, admin,
client and manager.  The theory was to keep each of the backend areas
in a controller but, I'm finding that layout to be problematic.

-- 
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