>>> from terminal_app.models import CntrOffload
>>> from django.db.models import Min
>>> CntrOffload.objects.aggregate(Min('exec_datetime'))
{'exec_datetime__min': datetime.datetime(2012, 12, 22, 0, 16, 28)}
>>> CntrOffload.objects.filter(vv_c='4588').aggregate(Min('exec_datetime'))
{'exec_datetime__min': datetime.datetime(2012, 12, 26, 3, 30, 32)}
>>>
No comments:
Post a Comment