Exemplo n.º 1
0
 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))
Exemplo n.º 2
0
Arquivo: user.py Projeto: 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))
Exemplo n.º 3
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))
Exemplo n.º 4
0
 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))
Exemplo n.º 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))
Exemplo n.º 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))
Exemplo n.º 7
0
 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))
Exemplo n.º 8
0
 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))