예제 #1
0
파일: comment.py 프로젝트: zgwdg/white
 def create(self, comment):
     """Create a new comment"""
     return db.execute(
         "INSERT INTO comments(post_id, name, email, content, status, created) VALUES(%s, %s, %s, %s, %s, %s)",
         (comment.post_id, comment.name, comment.email, comment.content,
          comment.status, comment.created))
예제 #2
0
파일: user.py 프로젝트: lf8289/white
 def create(self, user):
     return db.execute("INSERT INTO users(username, email, real_name, password, bio, status, role) \
          VALUES(%s, %s, %s, %s, %s, %s, %s)",
                       (user.username, user.email, user.real_name, user.password, user.bio, user.status, user.role))
예제 #3
0
파일: extend.py 프로젝트: lf8289/white
 def create(self, extend):
     """Create a new extend"""
     attributes = dumps(extend.attributes)
     return db.execute('INSERT INTO extend (`type`, `label`, `field`, `key`, `attributes`) VALUES (%s, %s, %s, %s, %s)',
             (extend.type, extend.label, extend.field, extend.key, attributes))
예제 #4
0
파일: category.py 프로젝트: lf8289/white
 def create(self, category):
     """Create a new category"""
     return db.execute("INSERT INTO categories(title, slug, description) VALUES(%s, %s, %s)",
                       (category.title, category.slug, category.description))
예제 #5
0
 def create(self, user):
     return db.execute(
         "INSERT INTO users(username, email, real_name, password, bio, status, role) \
          VALUES(%s, %s, %s, %s, %s, %s, %s)",
         (user.username, user.email, user.real_name, user.password,
          user.bio, user.status, user.role))
예제 #6
0
 def create(self, extend):
     """Create a new extend"""
     attributes = dumps(extend.attributes)
     return db.execute(
         'INSERT INTO extend (`type`, `label`, `field`, `key`, `attributes`) VALUES (%s, %s, %s, %s, %s)',
         (extend.type, extend.label, extend.field, extend.key, attributes))
예제 #7
0
파일: category.py 프로젝트: zgwdg/white
 def create(self, category):
     """Create a new category"""
     return db.execute(
         "INSERT INTO categories(title, slug, description) VALUES(%s, %s, %s)",
         (category.title, category.slug, category.description))
예제 #8
0
파일: comment.py 프로젝트: lf8289/white
 def create(self, comment):
     """Create a new comment"""
     return db.execute("INSERT INTO comments(post_id, name, email, content, status, created) VALUES(%s, %s, %s, %s, %s, %s)",
         (comment.post_id, comment.name, comment.email, comment.content, comment.status, comment.created))