[Grok-dev] Multiple Model Issue

Leonardo Rochael Almeida leorochael at gmail.com
Fri Oct 31 16:09:23 EDT 2008


Or possibly

On Fri, Oct 31, 2008 at 17:58, Brandon Craig Rhodes
<brandon at rhodesmill.org> wrote:
> Tim Cook <timothywayne.cook at gmail.com> writes:
>
>> ---------------------------------------------
>> 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
>
> Umm... that's because a bindex wraps b's, not a's, right?  The URL that
> should work would be:
>
> http://localhost:8080/b/bindex

Or possibly

http://localhost:8080/a/b/bindex

Assuming you have a "B" instance called "b" contained inside "a",
which we assume is an instance of "A".

Cheers, Leo


More information about the Grok-dev mailing list