분류 전체보기(752)
-
Django Built-in template tags and filters for문
VariableDescription forloop.counterThe current iteration of the loop (1-indexed) forloop.counter0The current iteration of the loop (0-indexed) forloop.revcounterThe number of iterations from the end of the loop (1-indexed) forloop.revcounter0The number of iterations from the end of the loop (0-indexed) forloop.firstTrue if this is the first time through the loop forloop.lastTrue if this is the l..
2021.02.04 -
Djang Admin widget 셋팅
formfield_overrides = { models.CharField: {'widget': forms.TextInput(attrs={'size': 1})}, models.TextField: {'widget': forms.Textarea(attrs={'rows': 1,'cols': 15})}, models.BooleanField: {'widget': forms.CheckboxInput(attrs={'value': 12})}, } widget 종류 'Media', 'MediaDefiningClass', 'Widget', 'TextInput', 'NumberInput', 'EmailInput', 'URLInput', 'PasswordInput', 'HiddenInput', 'MultipleHiddenInp..
2021.02.04 -
태그에 명시적으로 셋팅되지 않은 height 정보 가져오기
document.body.clientHeight document.getElementById('header').clientHeight
2021.02.03 -
div style 셋팅시 주의 점
width, height 셋팅시 'px'을 넣지 않으면 적용되지 않음
2021.02.03 -
canvas width, heigth 셋팅시 주의점
context 정의 전에 width, heigth를 변경해야 적용됨 [좋은 예] canvas = document.getElementById('box') canvas.width = img.width canvas.height = img.height context = canvas.getContext('2d') [나쁜 예] canvas = document.getElementById('box') context = canvas.getContext('2d') canvas.width = img.width canvas.height = img.height
2021.02.03 -
Django Model ForeignKey
생성할때는 객체를 넘여야 함 조회할때는 id값만 있어도 됨
2021.01.31