Mercurial > code > home > repos > href
comparison link.py @ 16:d44d3e4d415b
don't show other user's tags as previously-saved tags to the current user
Ignore-this: 89491c15006254dbd5a67970b3834ac7
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Sun, 17 Mar 2013 00:48:23 -0700 |
parents | e054949143e9 |
children | 8008ec2fd763 |
comparison
equal
deleted
inserted
replaced
15:4434b3dac18e | 16:d44d3e4d415b |
---|---|
22 forUsers.append(t[4:]) | 22 forUsers.append(t[4:]) |
23 else: | 23 else: |
24 tags.append(t) | 24 tags.append(t) |
25 doc['extracted'] = dict(tags=tags, forUsers=forUsers) | 25 doc['extracted'] = dict(tags=tags, forUsers=forUsers) |
26 | 26 |
27 def find(self, uri): | 27 def find(self, uri, user): |
28 docs = list(self.coll.find({'href': uri})) | 28 docs = list(self.coll.find({'href': uri, 'user' : user})) |
29 if len(docs) == 0: | 29 if len(docs) == 0: |
30 raise NotFound("not found") | 30 raise NotFound("not found") |
31 elif len(docs) > 1: | 31 elif len(docs) > 1: |
32 raise ValueError("%s docs found for href %s" % (len(docs), uri)) | 32 raise ValueError("%s docs found for href %s" % (len(docs), uri)) |
33 else: | 33 else: |