Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
R
red-ci-cd
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
red-group-test
red-ci-cd
Commits
3cc9c8fc
Commit
3cc9c8fc
authored
Jan 27, 2020
by
Gladys Forte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete all related to Branch Api
parent
3f6bd4cc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
44 deletions
+0
-44
app/applicationlayer/master/branch/serializer.py
app/applicationlayer/master/branch/serializer.py
+0
-9
app/applicationlayer/master/branch/views.py
app/applicationlayer/master/branch/views.py
+0
-33
app/applicationlayer/master/urls.py
app/applicationlayer/master/urls.py
+0
-2
No files found.
app/applicationlayer/master/branch/serializer.py
deleted
100644 → 0
View file @
3f6bd4cc
from
rest_framework
import
serializers
from
app.entities.models
import
Branch
class
BranchSerializer
(
serializers
.
ModelSerializer
):
class
Meta
:
model
=
Branch
fields
=
'__all__'
app/applicationlayer/master/branch/views.py
deleted
100644 → 0
View file @
3f6bd4cc
from
app.entities.models
import
Branch
from
rest_framework
import
viewsets
,
status
from
rest_framework.response
import
Response
from
django_filters
import
rest_framework
as
filters
from
app.applicationlayer.master.branch.serializer
import
BranchSerializer
from
app.applicationlayer.utils
import
(
CustomPagination
,
status_message_response
)
class
BranchViewSet
(
viewsets
.
ModelViewSet
):
queryset
=
Branch
.
objects
.
all
()
serializer_class
=
BranchSerializer
pagination_class
=
CustomPagination
lookup_field
=
'id'
def
list
(
self
,
request
,
*
args
,
**
kwargs
):
queryset
=
self
.
filter_queryset
(
self
.
get_queryset
())
page
=
self
.
paginate_queryset
(
queryset
)
if
page
is
not
None
:
serializer
=
self
.
get_serializer
(
page
,
many
=
True
)
message
=
status_message_response
(
200
,
'success'
,
'list of branches found'
,
serializer
.
data
)
return
self
.
get_paginated_response
(
message
)
serializer
=
self
.
get_serializer
(
queryset
,
many
=
True
)
return
Response
(
serializer
.
data
)
app/applicationlayer/master/urls.py
View file @
3cc9c8fc
...
...
@@ -6,14 +6,12 @@ from app.applicationlayer.master.company.views import AdminCompanyViewSet
from
app.applicationlayer.master.department.views
import
AdminDepartmentViewSet
from
app.applicationlayer.master.user_type.views
import
UserTypeViewSet
from
app.applicationlayer.master.attachment.views
import
MasterAttachmentViewSet
from
app.applicationlayer.master.branch.views
import
BranchViewSet
router
=
routers
.
DefaultRouter
()
router
.
register
(
r'users'
,
AdminAccountViewSet
)
router
.
register
(
r'companies'
,
AdminCompanyViewSet
)
router
.
register
(
r'departments'
,
AdminDepartmentViewSet
)
router
.
register
(
r'attachments'
,
MasterAttachmentViewSet
)
router
.
register
(
r'branches'
,
BranchViewSet
)
urlpatterns
=
[
path
(
''
,
include
(
router
.
urls
)),
...
...
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