This repository was archived by the owner on Feb 28, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Divide split api.serializers in chamber_of_deputies.serializers and c…
…ore.serializers
- Loading branch information
1 parent
c61cd85
commit e7bf9fb
Showing
2 changed files
with
27 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from rest_framework import serializers | ||
|
||
from jarbas.core.models import Activity, Company | ||
|
||
|
||
class ActivitySerializer(serializers.ModelSerializer): | ||
|
||
class Meta: | ||
model = Activity | ||
fields = ('code', 'description') | ||
|
||
|
||
class CompanySerializer(serializers.ModelSerializer): | ||
|
||
main_activity = ActivitySerializer(many=True, read_only=True) | ||
secondary_activity = ActivitySerializer(many=True, read_only=True) | ||
|
||
class Meta: | ||
model = Company | ||
exclude = ('id',) | ||
depth = 1 |