No Description
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.

datetime.py 612B

1234567891011121314151617
  1. # -*- coding: utf-8 -*-
  2. from ..data_field import DataField
  3. class DataHandler(DataField):
  4. help = 'A datetime field. Take two boolean options now_on_update and now_on_create'
  5. base_type = 'datetime'
  6. ## @brief A datetime field
  7. # @param now_on_update bool : If true, the date is set to NOW on update
  8. # @param now_on_create bool : If true, the date is set to NEW on creation
  9. # @param **kwargs
  10. def __init__(self, now_on_update=False, now_on_create=False, **kwargs):
  11. self.now_on_update = now_on_update
  12. self.now_on_create = now_on_create
  13. super().__init__(**kwargs)