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
ef064a8b
Commit
ef064a8b
authored
Jan 22, 2020
by
Gladys Forte
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #723 in RMS/api-main-service from gladys-dev2 to product-dev
* commit '
e879c0f0
': delete branch endpoint
parents
f4c3a009
e879c0f0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
69 deletions
+17
-69
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
-35
app/applicationlayer/master/urls.py
app/applicationlayer/master/urls.py
+0
-2
app/entities/migrations/0007_delete_branch.py
app/entities/migrations/0007_delete_branch.py
+16
-0
app/entities/models.py
app/entities/models.py
+1
-23
No files found.
app/applicationlayer/master/branch/serializer.py
deleted
100644 → 0
View file @
f4c3a009
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 @
f4c3a009
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'
# pagination.PageNumberPagination.page_size = 100
pagination_class
.
page_size
=
100
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 @
ef064a8b
...
...
@@ -7,14 +7,12 @@ 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.dashboard.views
import
RMSDashBoardViewSet
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
)),
...
...
app/entities/migrations/0007_delete_branch.py
0 → 100644
View file @
ef064a8b
# Generated by Django 2.2 on 2020-01-22 17:52
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'entities'
,
'0006_branch'
),
]
operations
=
[
migrations
.
DeleteModel
(
name
=
'Branch'
,
),
]
app/entities/models.py
View file @
ef064a8b
...
...
@@ -1272,26 +1272,4 @@ class ChangeRequestSettings(models.Model):
if
self
.
code
==
''
:
self
.
code
=
code
self
.
created
=
datetime
.
now
()
self
.
save
()
# branches info
class
Branch
(
models
.
Model
):
enviroment
=
models
.
CharField
(
max_length
=
255
)
branch_name
=
models
.
CharField
(
max_length
=
255
)
repo_type
=
models
.
CharField
(
max_length
=
50
)
repository
=
models
.
CharField
(
unique
=
True
,
max_length
=
255
)
created
=
models
.
DateTimeField
(
auto_now_add
=
True
)
class
Meta
:
db_table
=
'branches'
def
__str__
(
self
):
return
f
'{self.branch_name}'
\ No newline at end of file
self
.
save
()
\ No newline at end of file
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