2016-03-05 20:05:47 +08:00
|
|
|
from django.db.models import DateTimeField, Func
|
2015-06-02 01:00:34 +08:00
|
|
|
|
|
|
|
|
|
|
|
class TransactionNow(Func):
|
|
|
|
template = 'CURRENT_TIMESTAMP'
|
|
|
|
|
|
|
|
def __init__(self, output_field=None, **extra):
|
|
|
|
if output_field is None:
|
|
|
|
output_field = DateTimeField()
|
|
|
|
super(TransactionNow, self).__init__(output_field=output_field, **extra)
|