[Grok-dev] Multiple Model Issue

Tim Cook timothywayne.cook at gmail.com
Fri Oct 31 15:09:05 EDT 2008


Hi All,

Having read all I can find about multiple models in one application I
have an issue I cannot solve.

In a fairly stock grokproject; let's say that in app.py I have:

---------------------------------------------
import grok

from q.w.e import B  # class B inherits from grok.Model

class A(grok.Application,grok.Container):
   pass

class Index(grok.View):
   pass


class BIndex(grok.View):
   grok.context(B)
   grok.template('bindex')  # though this should be automatic?
---------------------------------------------

In the app_templates folder I have:

index.pt and bindex.pt

the url http://localhost:8080/a  works as expected.

the url http://localhost:8080/a/bindex gives me a Zope error:
The page that you are trying to access is not available

I get no erros on server startup and in fact at one point I added a
render method to BIndex and sure enough I got the expected error during
startup. So the template is associated correctly.  Also if I go
introspection it says that the template bindex is associated with the
class B.

So just how do you associate different templates with models inside the
same application?

Thanks,
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/20081031/d8884b27/attachment.bin 


More information about the Grok-dev mailing list