1월22일~1월28일

1월 22일 월요일

  1. Try-Django-Tutorial youtube 강의 9커밋까지 완료
  2. 하루3분 네트워크 독서
  3. 블로그 정리
    • about page 내용 작성 및 records 내용 정리 -> 이전부터 쭉 작성해 왔던 것들인데 미완성 된 부분도 있고 구성에 일관성이 없어서 한번 다시 쭉 정리해야할 필요성을 느낌

1월 23일 화요일

  1. Try-Django-Tutorial youtube 강의 17커밋까지 완료

    • class based view

    • template include, extends

    • model

    • Model 에서 DateTimeField 관련 모델에 DateTimeField를 적용 시켰는데 admin page에 보이질 않는다. 동영상 강의 에서는 분명히 보이는데 내가 안보이는 거라서 검색을 해봤고 stackoverflow에 다음과 같은 솔루션을 얻었다.

      If you really want to see date in the admin panel, you can add readonly_fields in admin.py:
      
      class RatingAdmin(admin.ModelAdmin):
          readonly_fields = ('date',)
      
      admin.site.register(Rating,RatingAdmin)
      Any field you specify will be added last after the editable fields. To control the order you can use the  fields options.
      
      Additional information is available from the Django docs.
      

      답변링크

      그리고 그대로 적용해 보았고, 수정할 수 없는 상태로 잘 나온다. 장고 문서에 아래와 같이 나와있어서

      As currently implemented, setting auto_now or auto_now_add to True will cause the field to have editable=False and blank=True set.
      

      모델 속성을 다음과 같이 바꾸고

      timestamp = models.DateTimeField(auto_now_add=True, editable=True, blank=True)
      updated = models.DateTimeField(auto_now=True, editable=True, blank=True)
      

      다시 admin에 나오나 확인해 봤는데 안나온다. auto_now_add, 와 auto_now 속성값이 editable과 blank를 True 설정되게 강제하는 것 같다. 혹시 몰라서 모든 속성값을 지우고 admin에 나오나 해봤는데 나온다.

      결국 auto_now_add, 와 auto_now 속성을 적용하고 admin에서 확인하기 위해서는 stackoverflow에 나온데로 admin 모듈에서 class로 설정해주는 방법이 현재로썬 최선인 것 같다.

    • query set

    • 장고 문서 복습 : Making queries, Templates(overview)

  2. 하루3분 네트워크 교실

1월 24일 수요일

  1. 장고 문서 복습 Making queries, 관련내용 posting

1월 25일 목요일

오늘 한일

  1. 장고 문서 복습 Making queries
  2. try django tutorial 26커밋 까지 완성

1월 26일 금요일

오늘 한일

  1. 장고 문서 복습 Making queries
  2. try django tutorial 35커밋 까지 완성