You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

12 lines
362 B

  1. from django.db.models import DateTimeField
  2. from django.db.models.functions import Func
  3. class TransactionNow(Func):
  4. template = 'CURRENT_TIMESTAMP'
  5. def __init__(self, output_field=None, **extra):
  6. if output_field is None:
  7. output_field = DateTimeField()
  8. super(TransactionNow, self).__init__(output_field=output_field, **extra)