Come aggiungere funzioni nel mio modello?
from django.db.models.functions import TruncMonth
ImportError: No module named functions
report.objects.filter(r_id=id, r_checkin_date__gte=checkin_date)
.annotate(month=ExtractMonth("timestamp"))
.values("month")
.annotate(count=Count("id"))
.values("month", "count")
risposte:
0 per risposta № 1Che versione su Django stai usando:
from django.db.models.functions.datetime import TruncMonth
è disponibile solo nella versione 1.10 e dev
ecco il codice sorgente collegamento