나의 재물운? 연애운은?
AI가 봐주는 내 사주팔자 - 운세박사
To extract a queryset which is not in another table using Django ORM, you can use the exclude()
method on the queryset. Here's an example:
# models.py
class MainModel(models.Model):
name = models.CharField(max_length=100)
class OtherModel(models.Model):
main_model = models.ForeignKey(MainModel, on_delete=models.CASCADE)
# views.py
main_models = MainModel.objects.all()
other_models = OtherModel.objects.values_list('main_model', flat=True)
excluded_main_models = main_models.exclude(id__in=other_models)
The exclude()
method returns a queryset of all MainModel
objects whose id
is not in the list of main_model
values from OtherModel
.
와 Django ORM 중인데 백엔드 만만하게 봤었는데 개어려웠는데 한 2시간 넘게 고민한 거 Chat GPT로 5분만에 품 ㅋㅋㅋㅋㅋ 와 질문을 개떡같이 했는데 이걸 잘 알아듣고 답을 주네 ㅋㅋㅋㅋ
나의 재물운? 연애운은?
AI가 봐주는 내 사주팔자 - 운세박사