示例#1
0
 def writeArticle(self):
     loginId = mem_serv.Service.loginId
     flag = self.memberService.loginCheck()
     if flag:
         print("글쓰기")
         title = input('title:')
         content = input('content:')
         w_date = input('w_date')
         self.dao.insert(vo.Board(0, loginId, w_date, title, content))
示例#2
0
 def selectByTitle(self, title):
     conn = self.connect()
     sql = 'select * from board where title=%s'
     cursor = conn.cursor()  # 사용할 커서 객체 생성
     cursor.execute(sql, title)  # sql실행. 실행한 결과는 cursor 객체에 담아
     row = cursor.fetchone()  #검색 결과 한줄추출
     conn.close()
     if row is not None:
         return arti.Board(row[0], row[1], row[2], row[3], row[4])
示例#3
0
 def selectAll(self):
     conn = self.connect()
     sql = 'select * from board'
     cursor = conn.cursor()  # 사용할 커서 객체 생성
     cursor.execute(sql)  # sql실행. 실행한 결과는 cursor 객체에 담아
     datas = []
     for row in cursor:
         datas.append(arti.Board(row[0], row[1], row[2], row[3], row[4]))
     conn.close()
     return datas
示例#4
0
 def selectByWriter(self, writer):
     conn = self.connect()
     sql = 'select * from board where writer=%s'
     cursor = conn.cursor()  # 사용할 커서 객체 생성
     cursor.execute(sql, writer)  # sql실행. 실행한 결과는 cursor 객체에 담아
     articles = []
     for row in cursor:
         articles.append(arti.Board(row[0], row[1], row[2], row[3], row[4]))
     conn.close()
     return articles
示例#5
0
 def __init__(self):
     self.dao = articleDao.Dao()
     self.Borad = vo.Board()
     self.memberService = mem_serv.Service()