Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
b97b3496
Commit
b97b3496
authored
Aug 24, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify api: complete some setting
parent
be92ac58
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
+15
-10
api_urls.py
apps/users/api_urls.py
+1
-7
serializers.py
apps/users/serializers.py
+14
-3
No files found.
apps/users/api_urls.py
View file @
b97b3496
...
...
@@ -2,14 +2,9 @@
#
from
django.conf.urls
import
url
,
include
from
rest_framework
import
routers
from
.api
import
UserViewSet
router
=
routers
.
DefaultRouter
()
router
.
register
(
r'users'
,
UserViewSet
)
urlpatterns
=
[
url
(
r'v1/'
,
include
(
router
.
urls
)),
url
(
r'^api-auth/'
,
include
(
'rest_framework.urls'
,
namespace
=
'rest_fr
\ No newline at end of file
]
apps/users/serializers.py
View file @
b97b3496
...
...
@@ -6,7 +6,19 @@ from rest_framework import serializers
from
.models
import
Role
,
User
,
UserGroup
class
UserSerializer
(
serializers
.
Hyperlinked
ModelSerializer
):
class
UserSerializer
(
serializers
.
ModelSerializer
):
class
Meta
:
model
=
User
fields
=
\ No newline at end of file
exclude
=
[
'first_name'
,
'last_name'
,
'is_staff'
]
class
UserGroupSerializer
(
serializers
.
ModelSerializer
):
class
Meta
:
model
=
UserGroup
fields
=
'__all__'
class
RoleSerializer
(
serializers
.
ModelSerializer
):
class
Meta
:
model
=
Role
fields
=
'__all__'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment