[Grok-dev] Re: Using POST request

Martijn Faassen faassen at startifact.com
Fri Mar 21 12:11:47 EDT 2008


Andreas Jung wrote:

> --On 21. März 2008 16:51:34 +0100 Martijn Faassen 
> <faassen at startifact.com> wrote:
>
>> Okay, so you made the root object (at localhost:8080) be the
>> grok.Application object 'eggserver'?
> 
> I have one instance of 'eggserver' instantiated as 'eggs'.
> So I want to post against localhost:8080/eggs.

Aah, right, I get it now.

Note that the alternative pattern would be to use an Index view:

class Index(grok.View):
    grok.context(eggserver)
    def render(self):
        if self.request.method == 'POST':
             ....

It's weird though that the REST story doesn't seem to be working; I 
suspect we're missing something simple, but what?

Hmm...I just noticed your MyREST2 doesn't actually say which layer it is 
in! Try:

class MyREST2(grok.REST):
    grok.context(eggserver)
    grok.layer(MyPubLayer)

    def POST(self):
        import pdb; pdb.set_trace()

Regards,

Martijn



More information about the Grok-dev mailing list