def date_trunc_sql(self, lookup_type, field_name):
        # http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC
        return "DATE_TRUNC('%s', %s)" % (lookup_type, field_name)
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/django/db/backends/postgresql/operations.py/DatabaseOperations.date_trunc_sql/original