I had this working last year, but I did it all in python after grabing basically all the data. Now I should be trying to do it as a database query cause it's better.
I have following query now which works.

all_info = db(
        (db.tag.id == db.users_tags.tag) \
&(db.auth_user.id == db.users_tags.user)).select()

It basiclaly joins the many to many relationship and I am able to see all user's tags. What I want to do is find all users that have at least one tag in common with auth.user_id and sort them by the most in common (Most of the same tags in common) to least in common (only one), and it would be counted.
Any ideas?

To further explain things let me show you my models...
The users are just like the default one that comes with the example app..
#TAGS
db.define_table('tag',
        Field('name', 'string', unique = True),
        Field('image', 'upload'),
        Field('description', 'text'),
        Field('conference', 'integer', readable=False, writable = False))

db.define_table('users_tags',
        Field('user', 'integer'),
        Field('conference', 'integer'),
        Field('tag', 'integer'))
#########################################
Any help with this would be very appreciated as this is still way over my head.
---
Best Regards,
Jason Brower

Reply via email to