os_template.py 929 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. from models import FilterFieldType
  4. from models import ORM
  5. __author__ = 'James Iter'
  6. __date__ = '2017/3/23'
  7. __contact__ = 'james.iter.cn@gmail.com'
  8. __copyright__ = '(c) 2017 by James Iter.'
  9. class OSTemplate(ORM):
  10. _table_name = 'os_template'
  11. _primary_key = 'id'
  12. def __init__(self):
  13. super(OSTemplate, self).__init__()
  14. self.id = 0
  15. self.label = None
  16. self.name = None
  17. self.active = None
  18. self.os_init_id = None
  19. @staticmethod
  20. def get_filter_keywords():
  21. return {
  22. 'name': FilterFieldType.STR.value,
  23. 'active': FilterFieldType.BOOL.value,
  24. 'os_init_id': FilterFieldType.INT.value
  25. }
  26. @staticmethod
  27. def get_allow_update_keywords():
  28. return ['active', 'os_init_id']
  29. @staticmethod
  30. def get_allow_content_search_keywords():
  31. return ['name']