os_init.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 OSInit(ORM):
  10. _table_name = 'os_init'
  11. _primary_key = 'id'
  12. def __init__(self):
  13. super(OSInit, self).__init__()
  14. self.id = 0
  15. self.name = None
  16. self.remark = ''
  17. @staticmethod
  18. def get_filter_keywords():
  19. return {
  20. 'name': FilterFieldType.STR.value,
  21. 'remark': FilterFieldType.STR.value
  22. }
  23. @staticmethod
  24. def get_allow_update_keywords():
  25. return ['remark']
  26. @staticmethod
  27. def get_allow_content_search_keywords():
  28. return ['name', 'remark']
  29. class OSInitWrite(ORM):
  30. _table_name = 'os_init_write'
  31. _primary_key = 'id'
  32. def __init__(self):
  33. super(OSInitWrite, self).__init__()
  34. self.id = 0
  35. self.os_init_id = None
  36. self.path = ''
  37. self.content = ''
  38. @staticmethod
  39. def get_filter_keywords():
  40. return {
  41. 'os_init_id': FilterFieldType.STR.value,
  42. 'path': FilterFieldType.STR.value
  43. }
  44. @staticmethod
  45. def get_allow_update_keywords():
  46. return ['os_init_id', 'path']
  47. @staticmethod
  48. def get_allow_content_search_keywords():
  49. return ['path', 'content']