Re: [Modeling-users] Greetings and questions
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2004-02-06 13:57:49
|
Hi Matthew, Matthew Patton <pa...@dm...> writes: > I have a question in this regard: I have Modeling working now > where it generated SQL schema and Ent. Objects based on my Model, and I > have used these objects to do simple tasks like inserting and fetching. > What I am trying to figure out now is how to use Zope to maintain the > state of a program that uses these Enterprise Objects. Basically, how do > I get Zope to give me the POST data that is submitted from a form, access > the appropriate user's session and his editing context in that session, > and then use a templating system to send HTML back? (the basic process of > a web app) I'm not sure I fully understand your question. Within Zope and given that you've installed the ZEditingContextSessioning product, you'll be able to get the session's editing context with: REQUEST.SESSION.defaultEditingContext(). There no other impact on traditional zope mechanisms: values in forms are passed to your methods as parameters and/or in REQUEST, and you can use the objects you get from e.g. ec.fetch() to populate the ZPT a method returns back. Last, you can decide if you want to control when sessions' ec save their changes, or if you want them to save their changes automatically after each request/response loop by setting the special parameter 'bind_saveChanges_to_zope_transactions', cf. http://modeling.sf.net/UserGuide/framework-integration-zope-options.html Hope this helps, -- S=E9bastien. |