model(4)
-
Spring boot에서 java 변수값을 템플릿에 출력하기
javaimport org.springframework.stereotype.Controller;import org.springframework.ui.Model;import org.springframework.web.bind.annotation.GetMapping;@Controllerpublic class MyController { @GetMapping("/show-variable") public String showVariable(Model model) { String message = "Hello, Spring Boot!"; model.addAttribute("myVariable", message); // Add the variable to the model ..
2024.11.17 -
Django DB에 이미지 저장 및 가져오기
image_data = models.BinaryField(null=True) box.image_data = base64.b64encode(output.getvalue()) if self.image_data != None : return format_html("",self.image_data.decode('UTF-8'))
2021.02.11 -
Django Model ForeignKey
생성할때는 객체를 넘여야 함 조회할때는 id값만 있어도 됨
2021.01.31 -
Django Model에 instance 추가
import glob import Image def updateImage() : images = [] images += glob.glob('./../*.tiff') images += glob.glob('./../*.png') for image in images : if Image.objects.filter(file=image).count() == 0 : Image(file=image).save()
2021.01.31