okay, got this below to work but am confused about the resulting order data 
is displayed in.

DATA

post.id 
<http://127.0.0.1:8000/checking_something/appadmin/select/db?orderby=post.id>
post.parent_id 
<http://127.0.0.1:8000/checking_something/appadmin/select/db?orderby=post.parent_id>
post.body 
<http://127.0.0.1:8000/checking_something/appadmin/select/db?orderby=post.body>
1 <http://127.0.0.1:8000/checking_something/appadmin/update/db/post/1> None 
<http://127.0.0.1:8000/checking_something/appadmin/select/db?query=db.post.id%3E0#>
 
<top dog - re...
2 <http://127.0.0.1:8000/checking_something/appadmin/update/db/post/2> 1 
<http://127.0.0.1:8000/checking_something/appadmin/update/db/post/1> <2nd 
dog - re...
3 <http://127.0.0.1:8000/checking_something/appadmin/update/db/post/3> 1 
<http://127.0.0.1:8000/checking_something/appadmin/update/db/post/1> < 3nd 
dog dow...
4 <http://127.0.0.1:8000/checking_something/appadmin/update/db/post/4> 2 
<http://127.0.0.1:8000/checking_something/appadmin/update/db/post/2> 
<grandchild 
-...
5 <http://127.0.0.1:8000/checking_something/appadmin/update/db/post/5> 1 
<http://127.0.0.1:8000/checking_something/appadmin/update/db/post/1> <record 
# 5, ...
6 <http://127.0.0.1:8000/checking_something/appadmin/update/db/post/6> 2 
<http://127.0.0.1:8000/checking_something/appadmin/update/db/post/2> < 
record #6, ...

Here is the result:

This is the default/show1.html template<top dog - record #1 points to 
nothing> <2nd dog - record #2 points to 1> <grandchild - record #4 but 
points to #2 > < record #6, points to 2> < 3nd dog down - record #3 
directly points to record# 1> <record # 5, points to #1 top dog>

shouldn't < 3nd dog down - record #3 directly points to record# 1>  be 
positioned right after parent record #1?

CONTROLLER

def show1():
    def show(row,n=0):
        return '  '*n+row.body+'\n'+''.join(show(c,n+1) for c in 
row.children)
    roots = db(db.post).select().as_trees()
    return locals()

MODEL

db.define_table('post',
                Field('parent_id','reference post'),
                Field('body'))


VIEW

{{extend 'layout.html'}}
<h1>This is the default/show1.html template</h1>
{{=show(roots[0])}}


   - How to wrap a href URL around each individual data item?
   - Is the resulting data intended to be feed into a visualizer like 
   fancyTree?
   

thanks

Alex

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to