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
df07e0d0
Commit
df07e0d0
authored
Sep 10, 2019
by
John Red Medrano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added company at module endpoint, allow null parent at departments
parent
29b239ac
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
2 deletions
+30
-2
app/applicationlayer/management/department/serializer.py
app/applicationlayer/management/department/serializer.py
+11
-1
app/entities/migrations/0004_auto_20190910_1610.py
app/entities/migrations/0004_auto_20190910_1610.py
+18
-0
app/entities/models.py
app/entities/models.py
+1
-1
No files found.
app/applicationlayer/management/department/serializer.py
View file @
df07e0d0
from
rest_framework
import
serializers
from
rest_framework
import
serializers
from
app.entities.models
import
Department
from
app.entities.models
import
Department
,
Company
class
DepartmentSerializer
(
serializers
.
ModelSerializer
):
class
DepartmentSerializer
(
serializers
.
ModelSerializer
):
def
to_representation
(
self
,
instance
):
company_name
=
Company
.
objects
.
filter
(
id
=
instance
.
company
.
id
)
.
values
()
.
first
()
ret
=
super
()
.
to_representation
(
instance
)
ret
[
'company'
]
=
company_name
# ret['application'] = application_name
return
ret
class
Meta
:
class
Meta
:
model
=
Department
model
=
Department
fields
=
'__all__'
fields
=
'__all__'
...
...
app/entities/migrations/0004_auto_20190910_1610.py
0 → 100644
View file @
df07e0d0
# Generated by Django 2.2 on 2019-09-10 16:10
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'entities'
,
'0003_auto_20190910_0956'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'module'
,
name
=
'parent'
,
field
=
models
.
IntegerField
(
blank
=
True
,
null
=
True
),
),
]
app/entities/models.py
View file @
df07e0d0
...
@@ -57,7 +57,7 @@ class Module(AuditClass):
...
@@ -57,7 +57,7 @@ class Module(AuditClass):
blank
=
True
,
blank
=
True
,
null
=
True
null
=
True
)
)
parent
=
models
.
IntegerField
()
parent
=
models
.
IntegerField
(
blank
=
True
,
null
=
True
)
sort_id
=
models
.
IntegerField
()
sort_id
=
models
.
IntegerField
()
component
=
models
.
CharField
(
component
=
models
.
CharField
(
max_length
=
255
,
max_length
=
255
,
...
...
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