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 649B

12345678910111213141516171819
  1. #-*- coding: utf-8 -*-
  2. from EditorialModel.fields import EmField
  3. class EmFieldDatetime(EmField):
  4. ftype = 'datetime'
  5. help = 'A datetime field. Take two boolean options now_on_update and now_on_create'
  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. def __init__(self, now_on_update = False, now_on_create = False, **kwargs):
  10. self.now_on_update = now_on_update
  11. self.now_on_create = now_on_create
  12. super(EmFieldDatetime, self).__init__(**kwargs)
  13. fclass = EmFieldDatetime