Hola, yes learning web2py basics. Could someone explain what I need to do 
to generate a sqlform.grid with two tables (one to many) that provides an 
href in one column?

The table i want to create would look like:

Contact             |          URL
-----------------------------------------------
t...@test.com   |  http://test.com



#-- My Model
db.define_table('contact',
                Field('email', 'string'),
                format='%(email)s'
                )

db.define_table('task',
                Field('contact_id', db.contact),
                Field('url', 'string'),
                format='%(url)s'


#-- My Controller
def get_emails():

    query = (db.contact.email)    

    default_sort_order = [db.contact.email]
    fields = (db.contact.email, db.task.url)
    headers = {
        'contact.email': 'Email',
        'task.url': 'URL'
    }


    form = SQLFORM.grid(query=query,
                        fields=fields,
                        headers=headers,
                        orderby=default_sort_order,
                        create=False,
                        deletable=False,
                        editable=False,
                        maxtextlength=64,
                        paginate=50)


    return dict(form=form)


I can not get the task table to render nor have I figured out how to 
specify the url as href. Thank you for guidance.

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