@@ -14,8 +14,8 @@ class UserInfoAdmin(admin.ModelAdmin): |
||
14 | 14 |
|
15 | 15 |
|
16 | 16 |
class AdministratorInfoAdmin(admin.ModelAdmin): |
17 |
- list_display = ('admin_id', 'phone', 'password', 'encryption', 'name', 'point_id', 'point_name', 'user_status', 'status', 'created_at', 'updated_at') |
|
18 |
- list_filter = ('user_status', 'status', 'point_name') |
|
17 |
+ list_display = ('point_id', 'point_name', 'admin_id', 'phone', 'password', 'encryption', 'name', 'user_status', 'status', 'created_at', 'updated_at') |
|
18 |
+ list_filter = ('point_name', 'user_status', 'status') |
|
19 | 19 |
readonly_fields = ('encryption', 'point_name') |
20 | 20 |
|
21 | 21 |
def save_model(self, request, obj, form, change): |
@@ -77,6 +77,9 @@ class AdministratorInfo(BaseModelMixin): |
||
77 | 77 |
(DELETED, '已删除'), |
78 | 78 |
) |
79 | 79 |
|
80 |
+ point_id = models.CharField(_('point_id'), max_length=32, blank=True, null=True, help_text='隔离点唯一标识', db_index=True) |
|
81 |
+ point_name = models.CharField(_('point_name'), max_length=255, blank=True, null=True, help_text='隔离点名称', db_index=True) |
|
82 |
+ |
|
80 | 83 |
admin_id = ShortUUIDField(_('admin_id'), max_length=32, blank=True, null=True, help_text='管理员唯一标识', db_index=True, unique=True) |
81 | 84 |
|
82 | 85 |
phone = models.CharField(_('phone'), max_length=11, blank=True, null=True, help_text='管理员电话', db_index=True) |
@@ -85,9 +88,6 @@ class AdministratorInfo(BaseModelMixin): |
||
85 | 88 |
|
86 | 89 |
name = models.CharField(_('name'), max_length=255, blank=True, null=True, help_text='管理员姓名') |
87 | 90 |
|
88 |
- point_id = models.CharField(_('point_id'), max_length=32, blank=True, null=True, help_text='隔离点唯一标识', db_index=True) |
|
89 |
- point_name = models.CharField(_('point_name'), max_length=255, blank=True, null=True, help_text='隔离点名称') |
|
90 |
- |
|
91 | 91 |
user_status = models.IntegerField(_('user_status'), choices=USER_STATUS_TUPLE, default=ACTIVATED, help_text='管理员状态', db_index=True) |
92 | 92 |
|
93 | 93 |
class Meta: |
@@ -100,8 +100,8 @@ class AdministratorInfo(BaseModelMixin): |
||
100 | 100 |
@property |
101 | 101 |
def data(self): |
102 | 102 |
return { |
103 |
- 'admin_id': self.admin_id, |
|
104 |
- 'name': self.name, |
|
105 | 103 |
'point_id': self.point_id, |
106 | 104 |
'point_name': self.point_name, |
105 |
+ 'admin_id': self.admin_id, |
|
106 |
+ 'name': self.name, |
|
107 | 107 |
} |