[스파르타7기] 개발일지2 - 2020.04.17

Tia Hwang·2020년 4월 17일
0

스파르타7기

목록 보기
3/12

오늘한일

1. 이메일+습관 입력시, 습관2와 습관3의 input이 빈칸이면 db에 저장되지 않도록 설정

  • for 문에 if문 추가
@app.route('/habits', methods=['POST'])
def saving():
    email_receive = request.form['email']
    habits_receive = request.form.getlist('habits[]')

    for h in habits_receive:
        if str(h).strip() == "":
            continue
        habit = {'email': email_receive, 'habit': h}
        db.habits.insert_one(habit)

2. "/habits"페이지에 FullCalendar JS 이용해서 달력 로딩

  • DB에 저장된 habit 내용 불러오기

3. css 적용이 안되는 문제 발생: 캐시 문제였음

  • 현직 개발자 친구가 알려준 치트키(👏🏻)
    -"?1=1" 이부분 추가..css 적용 계속 하려면 뒤의 숫자 1을 2,3,4 이런식으로 늘려가면 된다고함!
 <link rel="stylesheet"
       href="{{ url_for('static',
       filename='css/main.css') }}?1=1" />

해야할일

1. 이메일별로 My Habits가 로딩되도록 설정

2. 등록가능한 habit 갯수 제한(?)

3. statistic 화면 구현 방법 생각해보기

GitHub commit

profile
프론트엔드 개발자로 취업하기

1개의 댓글

comment-user-thumbnail
2020년 4월 17일

굳~~

답글 달기