os_template.py 986 B

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