[Grok-dev] REPOST Re: Add Form URLS

Tim Cook timothywayne.cook at gmail.com
Sat Jan 24 13:26:55 EST 2009


On Sat, 2009-01-24 at 18:58 +0100, Sebastian Ware wrote:

> 
> def add(self, **data):
>    new_obj = Ehr() # Create a new object
>    self.applyData(new_obj, **data) # Apply the changes (unless they  
> were supplied in the line above)
>    self.context[key] = new_obj # Store the object with a key of your  
> choice (think ordinary dictionary)
> 

I haven't tried this yet because I'd like to clarify your comments
below.

> Are you aware that you need a root container subclassing  
> grok.Application in order to be able to add an application to your  
> Grok instance? 

Well, yes I think.  I created Oship manually through the application
interface.  I assume that is why: from app import Oship works okay.

> This is also behaves like a dictionary, but  
> grok.Application, unlike grok.Container, kan be populated during  
> __init__. In other words, you can add your root Ehr object when you  
> are creating your app.

I'm attempting baby steps here.  I'll eventually want MANY EHR objects
inside Oship.clinical (with clinical be a single container within
Oship).

But I am getting the impression from your comments (in the code above)
that I need to create an HTML form to submit the data.  Whereas I
thought that subclassing  grok.AddForm would (at some URL) give me a
basic add form based on the schema.

???

--Tim



-- 
Timothy Cook, MSc
Health Informatics Research & Development Services
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook 
Skype ID == timothy.cook 
**************************************************************
*You may get my Public GPG key from  popular keyservers or   *
*from this link http://timothywayne.cook.googlepages.com/home*
**************************************************************
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/grok-dev/attachments/20090124/3747e5d6/attachment.bin 


More information about the Grok-dev mailing list