Well, in my concept of MVC (opinions may vary), the controller is the servlet, usually implemented in plain Python. The model is your generic Python modules, usually programmed without a dependency on Webware. The view would be a template, or if you are doing something more quick and dirty, it may be mixed in with the servlet (often doing the controller in awake(), and the view in writeContent()).
I prefer to pass the values around explicitly. By using higher-level objects (defined in your model), you can pass around things like the user, the transaction, the invoice, etc., without passing every detail (e.g., username, invoice number, total amount, etc). On some level everything has to be explicit, though with inheritance (via PSP or Cheetah) the template will have access to all the instance variables of the servlet, and you can kind of implicitly pass things that way. But for the most part Python resists implicit passing. On Fri, 2003-04-04 at 23:45, Randall wrote: > I'm trying to move over from PHP because I like the Python language better. > One thing I need to be able to do to make the switch is implement the MVC > model using Webware. > > In PHP, I would have one script act as a CONTROLLER, which would call on a > MODEL script. The MODEL script would return results (usually a DB query) > back to the CONTROLLER and the CONTROLLER would call the appropriate php > VIEW. The CONTROLLER usually passes the results to the VIEW so that they can > be displayed. This last part is what I don't know how to do with Webware. > In PHP, I could use require('view') and the results would be available to the > view script. > > Summarized: > > Once results are obtained using the MODEL and the appropriate VIEW is chosen, > how do I pass these results to the VIEW? > > Randall > > > ------------------------------------------------------- > This SF.net email is sponsored by: ValueWeb: > Dedicated Hosting for just $79/mo with 500 GB of bandwidth! > No other company gives more support or power for your dedicated server > http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ > _______________________________________________ > Webware-discuss mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/webware-discuss ------------------------------------------------------- This SF.net email is sponsored by: ValueWeb: Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss