Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23305

Filtering row with same column date value

$
0
0

I have a datetime field, and I want to filter the rows that has the same date value.

models.py

class EntryMonitoring(models.Model):    student = models.ForeignKey('Student', models.DO_NOTHING)    clockin = models.DateTimeField()    clockout = models.DateTimeField(null=True)

views.py

def check_attendance(request, nid):    day = EntryMonitoring.objects.filter(        clockout__isnull=False, '# same value', student=nid    ).annotate(...)    # do something

I wanted to add inside that filter query that clockin__date has the same value as clockout__date. Is that possible? If it is, what would be the right query to filter it?


Viewing all articles
Browse latest Browse all 23305

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>