| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import jimit as ji
- from filter import FilterFieldType
- from orm import ORM
- __author__ = 'James Iter'
- __date__ = '2018/10/7'
- __contact__ = 'james.iter.cn@gmail.com'
- __copyright__ = '(c) 2018 by James Iter.'
- class Project(ORM):
- _table_name = 'project'
- _primary_key = 'id'
- def __init__(self):
- super(Project, self).__init__()
- self.id = 0
- self.name = ''
- self.description = ''
- self.create_time = ji.Common.tus()
- @staticmethod
- def get_filter_keywords():
- return {
- 'id': FilterFieldType.INT.value,
- 'name': FilterFieldType.STR.value
- }
- @staticmethod
- def get_allow_update_keywords():
- return []
- @staticmethod
- def get_allow_content_search_keywords():
- return ['name']
- class Service(ORM):
- _table_name = 'service'
- _primary_key = 'id'
- def __init__(self):
- super(Service, self).__init__()
- self.id = 0
- self.project_id = 0
- self.name = ''
- self.description = ''
- self.create_time = ji.Common.tus()
- @staticmethod
- def get_filter_keywords():
- return {
- 'id': FilterFieldType.INT.value,
- 'project_id': FilterFieldType.INT.value,
- 'name': FilterFieldType.STR.value
- }
- @staticmethod
- def get_allow_update_keywords():
- return ['project_id']
- @staticmethod
- def get_allow_content_search_keywords():
- return ['name']
|