Permalink
Browse files

fix unique bug, add mem_cache for taglist

  • Loading branch information...
1 parent cd964af commit dccd81c73939f8b119794f54863ef3e6934f0649 Binux committed Nov 26, 2011
Showing with 3 additions and 1 deletion.
  1. +1 −1 db/model.py
  2. +2 −0 handlers/index.py
View
2 db/model.py
@@ -76,7 +76,7 @@ class User(Base, MySQLSettings):
__tablename__ = "user"
id = Column(Integer, primary_key=True)
- email = Column(String(1024), unique=True)
+ email = Column(String(512), index=True)
name = Column(String(256))
group = Column(String(64))
permission = Column(Integer)
View
2 handlers/index.py
@@ -4,6 +4,7 @@
from tornado.web import HTTPError, UIModule
from tornado.options import options
from .base import BaseHandler
+from libs.cache import mem_cache
TASK_LIMIT = 30
@@ -45,6 +46,7 @@ def render(self, tags):
return u", ".join(result)
class TagListModule(UIModule):
+ @mem_cache(2*60*60)
def render(self):
def size_type(count):
if count < 10:

0 comments on commit dccd81c

Please sign in to comment.