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))
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))
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))
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))
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))
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))
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))
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))