comparison taginthemiddle/model.py @ 2:1182315b18ac

add rudimentary code for handlers
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 04 May 2010 19:15:21 -0700
parents 837cfc05d4d9
children fc3491dfe374
comparison
equal deleted inserted replaced
1:837cfc05d4d9 2:1182315b18ac
1 """ 1 """
2 tags have: 2 tags have:
3 - a list of resources they're applied to 3 - a list of resources they're applied to
4 - a time they're applied 4 - a time they're applied
5 - for multi-user tags, the author should be passed (fudge for now)
5 for now just assume auth is on and that anyone authenticated may tag 6 for now just assume auth is on and that anyone authenticated may tag
6 e.g. a tags file 7 e.g. a tags file
7 8
8 foo = /bar:1273023556 /fleem/baz:1273023556 etc 9 foo = /bar:1273023556 /fleem/baz:1273023556 etc
9 cats = /cats:1273023556 /blog/mycat:1273023556 10 cats = /cats:1273023556 /blog/mycat:1273023556
61 def remove(self, tag, url): 62 def remove(self, tag, url):
62 if url not in self.tags[tag]: 63 if url not in self.tags[tag]:
63 return 64 return
64 self.tags[tag].remove(url) 65 self.tags[tag].remove(url)
65 self.urls[url].remove(tag) 66 self.urls[url].remove(tag)
67 del self.times[(tag, url)]
66 self.write() 68 self.write()