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
c1a76eef
authored
2023-07-06 16:01:29 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
MOD:用户权限移动到acc模块下
1 parent
5ecc003d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
20 deletions
src/apps/account/admin.py
src/apps/account/apps.py
src/apps/account/models.py
src/apps/account/views.py
src/apps/doc/admin.py
src/apps/doc/models.py
src/apps/account/admin.py
View file @
c1a76ee
...
...
@@ -18,7 +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
from
apps.
account
.models
import
UserRole
csrf_protect_m
=
method_decorator
(
csrf_protect
)
sensitive_post_parameters_m
=
method_decorator
(
sensitive_post_parameters
())
...
...
src/apps/account/apps.py
View file @
c1a76ee
...
...
@@ -3,3 +3,4 @@ from django.apps import AppConfig
class
AccountConfig
(
AppConfig
):
name
=
'apps.account'
verbose_name
=
'权限'
...
...
src/apps/account/models.py
View file @
c1a76ee
from
django.db
import
models
# Create your models here.
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"
,
blank
=
True
)
class
Meta
:
managed
=
False
db_table
=
'user_role'
verbose_name
=
'用户权限管理'
verbose_name_plural
=
verbose_name
\ No newline at end of file
...
...
src/apps/account/views.py
View file @
c1a76ee
...
...
@@ -9,7 +9,7 @@ from settings import conf
from
django.urls
import
reverse
from
django.http
import
HttpResponseRedirect
from
django.contrib.auth
import
login
as
auth_login
from
apps.
doc
.models
import
UserRole
from
apps.
account
.models
import
UserRole
# from django.conf import settings
# from django.shortcuts import resolve_url, redirect
...
...
src/apps/doc/admin.py
View file @
c1a76ee
from
django.contrib
import
admin
from
.models
import
Keywords
,
Configs
,
UserRole
from
.models
import
Keywords
,
Configs
from
.named_enum
import
KeywordsType
from
apps.myadmin.admin
import
admin_site
...
...
@@ -20,13 +20,7 @@ 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 @
c1a76ee
...
...
@@ -1098,14 +1098,4 @@ class HILCmsStatusInfo(models.Model):
class
Meta
:
managed
=
False
db_table
=
'hil_cms_status_info'
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"
,
blank
=
True
)
class
Meta
:
managed
=
False
db_table
=
'user_role'
verbose_name
=
'用户权限管理'
\ No newline at end of file
db_table
=
'hil_cms_status_info'
\ 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