Esempio n. 1
0
 def __init__(self):
     self.session = getSession()
     #settings数据
     blogsettings = self.session.query(Settings).all()
     self.bloginfos = {}
     for item in blogsettings:
         self.bloginfos[item.name] = item.content
     self.title = 'HOME'
     
     #顶部导航栏数据
     self.types = {}
     for type in self.session.query(Type).all():
         self.types[type.forurl] = type.name
     self.typeactive = 'HOME'
Esempio n. 2
0
def saveIntoDB(filename, type):
    session = getSession()
    session.add(Upload(type, filename , bucket_url  +  filename))
    session.commit()
Esempio n. 3
0
 def __init__(self):
     self.session = getSession()
     blog_name = self.session.query(Settings).filter(Settings.name=='BLOG_TITLE').one().content
     admin_name = self.session.query(Settings).filter(Settings.name=='BLOG_ADMIN_NAME').one().content
     self.staticdata = {'blog_name' : blog_name , 'admin_name' : admin_name}