[Grok-dev] URL Construction

Tim Cook timothywayne.cook at gmail.com
Fri May 1 17:06:29 EDT 2009


hi Michael,
Thanks for the prompt reply.


On Fri, 2009-05-01 at 22:41 +0200, Michael Haubenwallner wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Tim Cook wrote:
> > My URLs all LOOK good to me.  But each time I
> > get the ZMI page "The page that you are trying to access is not
> > available" with the Navigation box expanded and the correct item
> > highlighted. 
> 
> How about an example or two?

Okay, with this last attempt, I set the context of the view to Ehr and
name to index.  Like so:

class Ehr(grok.Container):
    """
    The container for each individual's clinical data.
    """    
    grok.context(bptrack)
            
class EhrIndex(grok.Viewlet):
    grok.context(Ehr)
    grok.name('index')
    grok.viewletmanager(DataArea)
    grok.order(3)
    
    def render(self):       
        return "<i>EHR Information Will be Displayed Here.</i>"
 
The URL is:
http://localhost:8080/bptrack/clinical/2009-05-01T17:52:46.791189

(obviously I'm using a datetime stamp to create the ids.)

If I try something like this:

class Ehr(grok.Container):
    """
    The container for each individual's clinical data.
    """    
    grok.context(bptrack)
            
class EhrIndex(grok.Viewlet):
    grok.context(bptrack)
    #grok.name('index')
    grok.viewletmanager(DataArea)
    grok.order(3)
    
    def render(self):
        
        return "<i>EHR Information Will be Displayed Here.</i>"

and construct the URL so it is:
http://localhost:8080/bptrack/clinical/2009-05-01T17:52:46.791189/ehrview

So there is 'a couple'. 

> How do your 'created' URLs look like and how should the 'correct' URLs
> look like?

Well, I THOUGHT that one of those would work. but I was wrong so I guess
I can't tell you how one SHOULD look. :-)  I guess that is my question.

> Do the 'correct' URLs work already when you access them directly from
> your browser?
> 

Hmmm, well, if I would have ever had a correct URL (one that caused the
display in the browser to work) I doubt I'd be taking your time on the
issue. :-)

BTW: I forgot to mention that using the object browser it seems to me
that EVERYTHING (all containers and attributes) are what and where they
should be.

I'm sure this is a matter of getting the context correct.  

Kind of reminds me when I was trying to figure out acquisition in Zope
(circa 1.5 or so?).  You know you're close; but it just ain't workin....

Cheers,
Tim



-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/grok-dev/attachments/20090501/53d64827/attachment.bin 


More information about the Grok-dev mailing list