2022. 12. 20. 08:59ㆍ카테고리 없음
노력하는 자를 이기는 것은 좌절 뿐이다 :: <Django 공부하기> @property decorator 알아보기 (tistory.com)
<Django 공부하기> @property decorator 알아보기
이번에는 Django models에서 decorator 중 하나인 @property를 알아보도록 하겠다. 다음의 예시를 보자: # models.py ... class Product(models.Model): name = models.CharField(max_length=200) price = models.FloatField() digital = models.B
hwan-hobby.tistory.com
Django decorator | @property (velog.io)
Django decorator | @property
@property 데코레이터는 메소드를 마치 필드인 것처럼 취급할 수 있도록 만들어 준다.아래와 같은 예시가 있다고 하자.여기서 full_name은 함수로 정의되어 있지만 @property 데코레이터가 사용되었다.
velog.io
Django Models 15편 - 이미 정의된 모델 메서드 오버라이드 하기 | 장고쟁이 (djangojeng-e.github.io)
Django Models 15편 - 이미 정의된 모델 메서드 오버라이드 하기
Overriding predefined model methods 여러분들이 커스터마이즈 하고 싶은 데이터베이스의 동작을 캡슐화 해주는 모델 메서드들도 존재 합니다. 특히 우리는 종종 save() 와 delete() 의 동작 방식을 바꾸고 싶
djangojeng-e.github.io
https://django-orm-cookbook-ko.readthedocs.io/en/latest/notequal_query.html
4. NOT 연산으로 조건을 부정하려면 어떻게 하나요? — Django ORM Cookbook 2.0 documentation
4. NOT 연산으로 조건을 부정하려면 어떻게 하나요? 장고의 사용자 계정 관리 앱인 django.contrib.auth 를 사용하면 데이터베이스에 auth_user 라는 표가 생성됩니다. 이 표에는 username, first_name, last_name
django-orm-cookbook-ko.readthedocs.io
https://itinerant.tistory.com/41
[Django] Database 테이블에 데이터가 없을 때 만 추가하는 방법
[Django] 테이블에 값이 없을 때만 추가하는 방법 아래와 같이 1) get() 으로 해당 데이터가 있는지 검사 (Select)2) 없으면 save()로 데이터 삽입 (Insert)try-catch 방식을 사용하여 작성이 가능하다. try: obj =
itinerant.tistory.com
[Django] Django ORM queryset 정리(model, filter, all, get, filter, exists, create, save)
Django를 하다보면 DB관련 모델링 작업이나 로직을 수행할 때 DB에 대해 직접적으로 SQL쿼리를 이용하여 DB관련 작업을 진행하는 방식이 아닌 django ORM을 통해 DB 테이블을 생성하고, C.R.U.D를 할 수 있
velog.io
https://itinerant.tistory.com/41
[Django] Database 테이블에 데이터가 없을 때 만 추가하는 방법
[Django] 테이블에 값이 없을 때만 추가하는 방법 아래와 같이 1) get() 으로 해당 데이터가 있는지 검사 (Select)2) 없으면 save()로 데이터 삽입 (Insert)try-catch 방식을 사용하여 작성이 가능하다. try: obj =
itinerant.tistory.com
https://django-orm-cookbook-ko.readthedocs.io/en/latest/notequal_query.html
4. NOT 연산으로 조건을 부정하려면 어떻게 하나요? — Django ORM Cookbook 2.0 documentation
4. NOT 연산으로 조건을 부정하려면 어떻게 하나요? 장고의 사용자 계정 관리 앱인 django.contrib.auth 를 사용하면 데이터베이스에 auth_user 라는 표가 생성됩니다. 이 표에는 username, first_name, last_name
django-orm-cookbook-ko.readthedocs.io