Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Api serializers #4

Merged
merged 44 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
b267d6f
Start api models for contribution agreement (#82)
SalmanAsh Jul 5, 2024
84fd2a1
api models for contribution
SalmanAsh Jul 8, 2024
1db562a
change import sorting and format
SalmanAsh Jul 8, 2024
b70bda6
fixture data for testing
SalmanAsh Jul 9, 2024
bdb7581
change model fields
SalmanAsh Jul 9, 2024
24dc96a
test string parsing
SalmanAsh Jul 9, 2024
46c522f
Migrate models
SalmanAsh Jul 9, 2024
8878e9f
fixture data for testing
SalmanAsh Jul 9, 2024
a7681a4
api models and tests files
SalmanAsh Jul 9, 2024
47306f6
fix import statements
SalmanAsh Jul 9, 2024
0af1004
fix code format
SalmanAsh Jul 9, 2024
7e69d68
Fix static types
SalmanAsh Jul 9, 2024
ef5f20c
fix linting test file format
SalmanAsh Jul 9, 2024
72c5654
import fix
SalmanAsh Jul 9, 2024
44dfbb6
Check static code
SalmanAsh Jul 9, 2024
cc05cc2
import sort
SalmanAsh Jul 9, 2024
77e5a80
update DateTime Field
SalmanAsh Jul 9, 2024
9a8f976
Tests for models
SalmanAsh Jul 9, 2024
269ace9
Repository testing
SalmanAsh Jul 9, 2024
6249929
fix class name
SalmanAsh Jul 10, 2024
20a9537
tests for models
SalmanAsh Jul 10, 2024
9f55c76
correct formatting and comments
SalmanAsh Jul 10, 2024
def8ff7
Change meta classes
SalmanAsh Jul 10, 2024
0a22567
Fix code format and imports
SalmanAsh Jul 10, 2024
b5ec844
Delete all fruit files
SalmanAsh Jul 10, 2024
93f7398
Delete last fruit migration
SalmanAsh Jul 10, 2024
9fba816
Fix migration issue
SalmanAsh Jul 10, 2024
5dab9d0
change data fields
SalmanAsh Jul 10, 2024
8b23360
Apply changes after review
SalmanAsh Jul 10, 2024
9fe496d
apply initial migrations
SalmanAsh Jul 10, 2024
7f3efa4
Fix contributor type error
SalmanAsh Jul 10, 2024
bf18e02
Add verbose names
SalmanAsh Jul 11, 2024
bf17776
Fix import error
SalmanAsh Jul 11, 2024
7fe08cd
Create api serializers
SalmanAsh Jul 11, 2024
f9029e3
Test the serializer's functionality
SalmanAsh Jul 12, 2024
b421334
Check static code
SalmanAsh Jul 12, 2024
c040e51
Add module doc strings
SalmanAsh Jul 12, 2024
276b709
Contributor tests
SalmanAsh Jul 12, 2024
6588722
Apply changes from second review
SalmanAsh Jul 12, 2024
519dfdd
Migrate models
SalmanAsh Jul 12, 2024
f7f88b4
Updated models from merge
SalmanAsh Jul 12, 2024
18decc5
Fix doc strings
SalmanAsh Jul 12, 2024
72a1729
Merge from dev
SalmanAsh Jul 16, 2024
1f2dbfd
apply review changes
SalmanAsh Jul 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/serializers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
© Ocado Group
Created on 02/07/2024 at 12:00:12(+01:00).
"""

from .agreement_signature import AgreementSignatureSerializer
from .contributor import ContributorSerializer
17 changes: 17 additions & 0 deletions api/serializers/agreement_signature.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""
© Ocado Group
Created on 12/07/2024 at 14:07:45(+01:00).
"""

from codeforlife.serializers import ModelSerializer
from codeforlife.user.models import User

from ..models import AgreementSignature


class AgreementSignatureSerializer(ModelSerializer[User, AgreementSignature]):
"""Agreement serializer class"""

class Meta:
model = AgreementSignature
fields = "__all__"
18 changes: 18 additions & 0 deletions api/serializers/agreement_signature_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""
© Ocado Group
Created on 12/07/2024 at 17:16:58(+01:00).
"""

from codeforlife.tests import ModelSerializerTestCase
from codeforlife.user.models import User

from ..models import AgreementSignature
from .agreement_signature import AgreementSignatureSerializer


class TestAgreementSignatureSerializer(
ModelSerializerTestCase[User, AgreementSignature]
):
"""Test the Agreement Signature serializers"""

model_serializer_class = AgreementSignatureSerializer
16 changes: 16 additions & 0 deletions api/serializers/contributor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
© Ocado Group
Created on 12/07/2024 at 14:07:59(+01:00).
"""
from codeforlife.serializers import ModelSerializer
from codeforlife.user.models import User

from ..models import Contributor


class ContributorSerializer(ModelSerializer[User, Contributor]):
"""Contributor serializer class"""

class Meta:
model = Contributor
fields = "__all__"
16 changes: 16 additions & 0 deletions api/serializers/contributor_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
© Ocado Group
Created on 12/07/2024 at 11:36:23(+01:00).
"""

from codeforlife.tests import ModelSerializerTestCase
from codeforlife.user.models import User

from ..models import Contributor
from .contributor import ContributorSerializer


class TestContributorSerializer(ModelSerializerTestCase[User, Contributor]):
"""Test the Contributor serializers"""

model_serializer_class = ContributorSerializer
Loading