Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
5ecc003d
authored
2023-07-06 14:56:34 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
MOD:用户权限移动到acc模块下
1 parent
bf66043f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
src/apps/account/admin.py
src/apps/doc/admin.py
src/apps/doc/models.py
src/apps/account/admin.py
View file @
5ecc003
...
...
@@ -18,6 +18,7 @@ from django.utils.translation import gettext, gettext_lazy as _
from
django.views.decorators.csrf
import
csrf_protect
from
django.views.decorators.debug
import
sensitive_post_parameters
from
apps.myadmin.admin
import
admin_site
from
apps.doc.models
import
UserRole
csrf_protect_m
=
method_decorator
(
csrf_protect
)
sensitive_post_parameters_m
=
method_decorator
(
sensitive_post_parameters
())
...
...
@@ -203,6 +204,11 @@ class UserAdmin(admin.ModelAdmin):
request
.
POST
[
'_continue'
]
=
1
return
super
()
.
response_add
(
request
,
obj
,
post_url_continue
)
# Register your models here.
class
UserRoleAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'id'
,
'auth_user_id'
,
'role'
)
admin_site
.
register
(
Group
,
GroupAdmin
)
admin_site
.
register
(
User
,
UserAdmin
)
admin_site
.
register
(
UserRole
,
UserRoleAdmin
)
...
...
src/apps/doc/admin.py
View file @
5ecc003
from
django.contrib
import
admin
from
.models
import
Keywords
,
Configs
from
.models
import
Keywords
,
Configs
,
UserRole
from
.named_enum
import
KeywordsType
from
apps.myadmin.admin
import
admin_site
...
...
@@ -20,7 +20,13 @@ class ConfigsAdmin(admin.ModelAdmin):
list_display
=
(
'id'
,
'value'
,
'comment'
)
# Register your models here.
class
UserRoleAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'id'
,
'auth_user_id'
,
'role'
)
admin_site
.
register
(
Keywords
,
KeywordsAdmin
)
admin_site
.
register
(
Configs
,
ConfigsAdmin
)
admin_site
.
register
(
UserRole
,
UserRoleAdmin
)
# admin.site.site_header = '宝马OCR'
# admin.site.site_title = '宝马OCR'
...
...
src/apps/doc/models.py
View file @
5ecc003
...
...
@@ -1103,8 +1103,9 @@ class UserRole(models.Model):
id
=
models
.
AutoField
(
primary_key
=
True
,
verbose_name
=
"id"
)
# 主键
auth_user_id
=
models
.
SmallIntegerField
(
null
=
False
,
default
=
0
,
verbose_name
=
"auth_user_id"
)
role
=
models
.
SmallIntegerField
(
null
=
False
,
default
=
0
,
verbose_name
=
"role"
)
menu_list
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"menu_list"
)
menu_list
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"menu_list"
,
blank
=
True
)
class
Meta
:
managed
=
False
db_table
=
'user_role'
verbose_name
=
'用户权限管理'
\ No newline at end of file
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment