os_template.py 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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.path = None
  17. self.active = None
  18. self.icon = None
  19. self.os_init_id = None
  20. @staticmethod
  21. def get_filter_keywords():
  22. return {
  23. 'id': FilterFieldType.INT.value,
  24. 'label': FilterFieldType.STR.value,
  25. 'path': FilterFieldType.STR.value,
  26. 'active': FilterFieldType.BOOL.value,
  27. 'os_init_id': FilterFieldType.INT.value
  28. }
  29. @staticmethod
  30. def get_allow_update_keywords():
  31. return ['active', 'os_init_id']
  32. @staticmethod
  33. def get_allow_content_search_keywords():
  34. return ['label', 'path']