ssh_key.py 953 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import jimit as ji
  4. from filter import FilterFieldType
  5. from orm import ORM
  6. __author__ = 'James Iter'
  7. __date__ = '2018/2/26'
  8. __contact__ = 'james.iter.cn@gmail.com'
  9. __copyright__ = '(c) 2018 by James Iter.'
  10. class SSHKey(ORM):
  11. _table_name = 'ssh_key'
  12. _primary_key = 'id'
  13. def __init__(self):
  14. super(SSHKey, self).__init__()
  15. self.id = 0
  16. self.label = None
  17. self.public_key = None
  18. self.create_time = ji.Common.ts()
  19. @staticmethod
  20. def get_filter_keywords():
  21. return {
  22. 'id': FilterFieldType.INT.value,
  23. 'label': FilterFieldType.STR.value,
  24. 'public_key': FilterFieldType.STR.value,
  25. 'create_time': FilterFieldType.INT.value
  26. }
  27. @staticmethod
  28. def get_allow_update_keywords():
  29. return []
  30. @staticmethod
  31. def get_allow_content_search_keywords():
  32. return ['label']