Voltron

I don't think you answered the original question which was basically
"if you are going to specify a link in a page then is specifying that
link the responsibility of the the model, the controller or the view?"

RE your other points:

"All URLs should be able to handle files/REST/PUT": at this point, the
Resource approach is intended to keep the existing web2py controller/
function structure but "tidy up" the mvc separation.  My next mission,
should i choose to accept it :-), will be to develop a RESTful
structure - initial thoughts at
http://www.wellbehavedsystems.co.uk/web2py/examples/rest.html and
rest_alt1.html  But that is a bigger change as it changes the
controller/action structure.

"Simplify...a resource [just] takes a dictionary of values and
attributes": I think there are 2 issues: a) presenting a common
Resource interface (accepts, persists, as) when python doesn't really
do interfaces (as I understand it)  and b) where to put the logic/data
that is being moved.

In Java, I would probably have a Resource interface that was
implemented by classes that extended the existing web2py structures
(record=SQLStorage, list=SQLRows, collection=not sure).  In Python,
tho' I am still learning, putting everything in one class called
Resource (if that is your suggestion) doesn't seem right to me as each
kind of resource implements the interface differently. As I don't want
Resource to be a lot of "if type=='record else" statements, having
different classes seems better.  I don't see these classes a
enumerations - they merely associate logic with existing
enumerations.  I suppose my question back would be "what is a more
pythonic way of meeting the design requirements?"

On Nov 15, 11:58 am, voltron <[EMAIL PROTECTED]> wrote:
> Would it be possible to simplify the flow by just stating a resource
> takes a dictionary of values and attributes and the enumerations
> Collection, Record, List should  conform somehow? My reasons:
>
> 1. Web2py hast its own database idioms for collection types for the
> DAL, that would mean we have to more
> 2. Its not so pythonic to me as python already has a host of
> enumerations  like lists,tuples and dictionaries
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to