Thanks! it works!
On Mon, Jun 16, 2014 at 6:32 PM, LoveWeb2py atayloru...@gmail.com wrote:
If you want to get 'Victor' in a view you could do something simple like:
Controller:
def name_return():
name = 'Victor'
return dict(name=name)
view name_return.html:
{{extend
This doesn't look anything like typical web2py code. I would recommend that
you read some of the book and follow the typical patterns and then come
back with questions if you're having trouble. In general, though, note that
you won't be using the print statement to display anything in HTML
On Monday, June 16, 2014 6:08:55 AM UTC-4, Maurice Waka wrote:
My code:
class Person():
name = 'Victor'
def say(self, what):
print(self.name, what)
getattr(person, attr_name)
How do I display 'Victor' on web2py html.view?
I tried using:
{{=getattr(person,
If you want to get 'Victor' in a view you could do something simple like:
Controller:
def name_return():
name = 'Victor'
return dict(name=name)
view name_return.html:
{{extend 'layout.html'}}
{{=name}}
--
Resources:
- http://web2py.com
- http://web2py.com/book
I guess you need to familiarize yourself more with not just with web2py but
also with web development, right?
Anthony is right, you should read web2py book at www.web2py.com/book, at
least the first chapters to get a start.
At first you need to understand MVC.
For example you may have:
in db.py
5 matches
Mail list logo