So we have gotten close with this:
def status():
    current_user_id=auth.user.id
    tags = db((db.users.id==db.user_tags.user_id)
        &(db.user_tags.tag_id==db.tag.id)
        &(db.user_tags.tag_id.belongs(
        db(db.user_tags.user_id==current_user_id)._select(
        db.user_tags.tag_id)))).select(
        db.users.ALL,db.tag.ALL,groupby=db.users.id)
    response.title = "Your Profile Page"
    userForm = SQLFORM(db.users)
    if userForm.accepts(request.vars):
        response.flash='User Added!'
    elif userForm.errors: response.flash='Hmm... Something is wrong
here...'
    return dict(tags= tags, userForm = userForm, today=today, user =
auth.user)

But I was hoping to get a list like this...
Username1
|-- Tag1
|-- Tag2
|-- Tag4
|-- Tag5
Username2
|-- Tag1
|-- Tag3
|-- Tag4
Username3
|-- Tag2
|-- Tag4
|-- Tag5
|-- Tag6
Username4
|-- Tag1
|-- Tag4
|-- Tag6
AND vice versa
With the users under the tags...
I am pretty new at this, sorry...
With this I could make a cloud with sub clouds.
I have the cloud working rather well.  I just need it to sort like this.
Is there a way to do this with the query, or should I try to work with
the data in python itself and sort through the issue.
My relevant tables...
db.define_table('users',
        SQLField('first_name', 'string', length=15),
        SQLField('last_name', 'string', length=15),
        SQLField('phone_number', 'string', length=15),
        SQLField('email', 'string'),
        SQLField('password', 'password'),
        SQLField('university_affiliation', 'string', length=25),
        SQLField('created', 'datetime', default=now, readable=False,
writable=False),
        SQLField('registration_key', length=128, writable=False,
readable=False, default=''),
        SQLField('avatar', 'upload'),
        SQLField('short_description','text'))
db.define_table('tag',
        SQLField('name', 'string'),
        SQLField('description', 'text'),
        SQLField('logo', 'upload'),
        SQLField('created', 'date', default=now, writable=False),
        SQLField('creator', 'string', writable=False))
db.define_table('user_tags',
        SQLField('tag_id',db.tag),
        SQLField('user_id',db.users))
Sorry for being a pest, I am a slow learner. :(
Regards,
Jason


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---


Reply via email to