class Notification(TimeStampedModel):
read_datetime = models.DateTimeField(
'읽은 일시',
null=True,
default=None,
)
In [2]: Notification.objects.filter(read_datetime__isnull=False)
Out[2]: SELECT "communications_notification"."id",
"communications_notification"."read_datetime"
FROM "communications_notification"
WHERE "communications_notification"."read_datetime" IS NOT NULL
LIMIT 21
Execution time: 0.004612s [Database: default]
In [1]: Notification.objects.exclude(read_datetime=None)
Out[1]: SELECT "communications_notification"."id",
"communications_notification"."read_datetime"
FROM "communications_notification"
WHERE NOT ("communications_notification"."read_datetime" IS NULL)
LIMIT 21
Execution time: 0.007794s [Database: default]