say I have a model like this:
class Arrival(models.Model):
client = models.ForeignKey(User, related_name='client')
time = models.DateTimeField()
Now I would like to plot a graph with number of unique client visits at each date.
My current approach is to use:
Arrival.objects.values('client','time')
afterwards convert all the datetime field to a date field. Use python library to get a list of unique date, and then iterate through the clients to find out how many clients visit per date.
Do anyone have a more efficient approach please?