thanks,
and maybe I'm doing it totally wrong ....
On 28-11-2010 21:33, mdipierro wrote:
> If you have
>
> @service.run
> def Set_Page ( Book, Chapter, Paragraph ): return 'check'
>
> def call(): return service()
>
> you can redirect to this with
>
> redirect(URL('call',args=('run','Set_Pgae',book,chapter,paragraph)))
>
> But I do not see why you would every redirect a user to a service. A
> service is not designed to return html pages.
But from the book I understood that if you want functions ( controllers) with
parameters,
you have to use services.
Am I wrong ?
The application looks like the web2py book application,
but differs in a number of ways,
- it's larger on the top side, i.e. it consists of a number of books (up to 10),
- it's divided into more detail, not a whole chapter is shown, but just one
paragraph
- pages can contains forms, where the user must give answers
- there should be a communication channel beside the book ( not realized yet)
The current example, although not completely filled with real information,
contains 6 books, each with about 20 chapters, each chapter has between 5 and
25 paragraphs.
The controls on page ( mostly jquery menus), and the links embedded in the
content,
determine which is the next page to shown control.
So each of these controls or links, determine book, chapter, paragraph,
and they all go to a relative simple function, that extracts the pages from a
database
(at the moment the texts (and some layout information) are read from a python
file, where the texts
are placed in a nested list structure)
and shows the pages in an uniform way.
What's the better way to solve this ?
(btw is the web2py book application already available ?, couldn't wait ;-) )
thanks again,
Stef
>
> On Nov 28, 1:51 pm, Stef Mientki <[email protected]> wrote:
>> hello,
>>
>> I got a simple web2py site almost running,
>> and I'm trying to put it onto a server right now,
>> ( I want to show it tomorrow to some people)
>> but I'm stocked on a question with a probably very simple answer:
>>
>> I've an intro page with a login button at the top,
>> this page is generated by the controller default.py : index
>>
>> After a succesfull log in, I want to redirect to the content of the site,
>> which is a function with parameters ( service )
>>
>> @service.run
>> def Set_Page ( Book, Chapter, Paragraph ):
>>
>> How can I redirect to the service "Set_Page" after a succesfull login ?
>>
>> In a somewhat simpeler form, I tried this (which doesn't work):
>>
>> def index():
>> if request.vars.visitor_name :
>> redirect ( URL ( 'first') )
>> response.flash = T('Welcome to My First Page')
>> return dict(message=T('Hello World'))
>>
>> def first():
>> return dict ( message= 'AAP' )
>>
>> thanks,
>> Stef Mientki