Permalink
Browse files

modified: adminviews.py

modified:   deploy.py
modified:   models.py
  • Loading branch information...
David Xie
David Xie committed Jun 9, 2010
1 parent 7dec9cf commit 4f4722a5cdf23e70f4fc1d844bab646bdc30a66c
Showing with 11 additions and 8 deletions.
  1. +8 −5 davidblog/adminviews.py
  2. +2 −2 davidblog/deploy.py
  3. +1 −1 davidblog/models.py
View
@@ -114,6 +114,9 @@ def GET(self, id):
if entry:
f = entryForm()
entry.tagList = ",".join([i.name for i in entry.tags])
+ f.title.value = entry.title
+ f.slug.value = entry.slug
+ f.content.value = entry.content
d['entry'] = entry
d['f'] = f
return render.entry_edit(**d)
@@ -142,15 +145,15 @@ def POST(self, id):
for tag in tagsDel:
t = web.ctx.orm.query(Tag).filter('LOWER(name)=:name').params(name=tag).first()
if t:
- if t.entryNum == 1:
+ if t.entry_num == 1:
web.ctx.orm.delete(t)
else:
- t.entryNum = t.entryNum - 1
+ t.entry_num = t.entry_num - 1
entry.tags.remove(t)
entry.title = f.title.value
entry.slug = f.slug.value
entry.content = f.content.value
- entry.modifiedTime = datetime.now()
+ entry.modified_time = datetime.now()
return web.seeother('/entry/list/')
else:
d['f'] = f
@@ -165,10 +168,10 @@ def GET(self, id):
if len(entry.tags) > 0:
for tag in entry.tags:
tagsToDel = list()
- if tag.entryNum == 1:
+ if tag.entry_num == 1:
tagsToDel.append(tag)
else:
- tag.entryNum = tag.entryNum - 1
+ tag.entry_num = tag.entry_num - 1
entry.tags.remove(tag)
web.ctx.orm.delete(entry)
if len(tagsToDel) > 0:
View
@@ -22,8 +22,8 @@
app.add_processor(web.loadhook(views.my_loadhook))
app.add_processor(views.my_handler)
-#app.notfound = notfound
-#app.internalerror = internalerror
+app.notfound = views.notfound
+app.internalerror = views.internalerror
def getSession():
if '_session' not in web.config:
View
@@ -25,7 +25,7 @@ class Comment(Base):
username = Column(String(50))
url = Column(String(50))
comment = Column(Text)
- created_time = Column(DateTime)
+ created_time = Column(DateTime, default=datetime.now())
def __init__(self, entry_id, username, email, url, comment):
self.entry_id = entry_id

0 comments on commit 4f4722a

Please sign in to comment.