Then I think I completely misunderstood your problem and what your goal is. 
 What is it you're trying to do?

Where is your present template?  If you mean that you want the template 
file named index.html, then you can simply rename my order.html file and 
change the name in the controller code.

-Jim

On Saturday, August 5, 2017 at 10:54:02 PM UTC-5, Samuel Gosling wrote:
>
> Yes that works! Thank you! But it only focuses on my form not my template. 
> How can i contain it as a form on my present template as I am doing with 
> the LOAD function, because I want this form to show up in index.html that's 
> where it won't load. 
>
> On Friday, August 4, 2017 at 5:15:17 PM UTC+1, Jim S wrote:
>>
>> Your db.py is fine.
>>
>> default.py should contain:
>> def order():
>>     response.view = 'default/order.html'
>>     order = SQLFORM(db.order,
>>                    submit_button='Buy!',
>>                    buttons=['submit'],
>>     formstyle='table3cols')
>>     if order.process(keepvalues=True).accepted:
>>         session.flash = 'Order submitted.'
>>         redirect(URL('payment'))
>>     elif order.errors:
>>         session.flash = 'Error.'
>>     else:
>>         session.flash = 'Please enter a wallet address.'
>>     return dict(order=order)
>>
>>
>> order.html should be:
>>
>> {{extend 'layout.html'}}
>> {{=order}}
>>
>>
>> Tested on my system and works as expected.
>>
>> -Jim
>>
>>
>> On Friday, August 4, 2017 at 10:51:30 AM UTC-5, Samuel Gosling wrote:
>>>
>>> I declared that that didn't work unfortunately,  if you read my text 
>>> properly. Appreciate the suggestions nonetheless! 
>>>
>>> On Friday, August 4, 2017 at 3:52:56 PM UTC+1, Áureo Dias Neto wrote:
>>>>
>>>> Your 'form' is in the variable order, here:  order = 
>>>> SQLFORM(db.order,...
>>>>
>>>> use {{=order}} in the view
>>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to