Model:
dbhealth = DAL('sqlite://wellness.db',folder='/home/maurice/web2py')
dbhealth.define_table( "health",
                              Field('name', 'string'),
                              Field('definition', 'text', length= 1000000,
default="We'll update soon.", notnull=True),
                              .....

in controller:

@auth.requires_login()#membership('managers')->this gives an errors bout q
not being defined in view_searches
defnotes():
    dbhealth.health.id.readable = False
    g = SQLFORM.grid(dbhealth.health, searchable=True, csv=False,
user_signature=True, )
    return dict(form = g)
@auth.requires_login()
def upd_healthinsure():
    id,column = request.post_vars.id.split('.')
    value = request.post_vars.value
    dbhealth(dbwellness.health.id == id).update(**{column:value})
    return value

    ....more code

name3 = 'testing string 123'
db.answers.insert(quest=name3)
    replies = db(db.answers.author == auth.user.id
).select(db.answers.ALL)[-5:-1]
    question = db(db.answers.author == auth.user.id
).select(orderby=~db.answers.created_on,limitby=(2,0))
    return dict(form=form, question=question, replies=replies)

This is how I have it. I hope its clear.
regards

On Sat, Apr 7, 2018 at 12:01 AM, Anthony <abasta...@gmail.com> wrote:

> @auth.requires_login()
>> def notes():
>>     dbhealth.health.id.readable = False
>>     g = SQLFORM.grid(dbhealth.health, searchable=True, csv=False,
>> user_signature=True, )
>>     return dict(form = g)........code
>> question = db(db.answers.author == auth.user.id).select(orderby=~
>> db.answers.created_on,limitby=(2,0))
>> return dict(form=form, question=question)
>>
>
> The above is not valid Python code. Please show the real code.
>
> Anthony
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/YQhEantsews/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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