Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop' into release-2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
obdulia-losantos committed Oct 6, 2021
2 parents 206a77f + 734a9b4 commit 7344a3a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
15 changes: 15 additions & 0 deletions aether-kernel/aether/kernel/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class MappingSetSerializer(DynamicFieldsMixin, DynamicFieldsModelSerializer):

project = MtPrimaryKeyRelatedField(
queryset=models.Project.objects.all(),
style={'base_template': 'input.html'},
)

class Meta:
Expand All @@ -150,10 +151,12 @@ class MappingSerializer(DynamicFieldsMixin, DynamicFieldsModelSerializer):
project = MtPrimaryKeyRelatedField(
queryset=models.Project.objects.all(),
required=False,
style={'base_template': 'input.html'},
)
mappingset = MtPrimaryKeyRelatedField(
queryset=models.MappingSet.objects.all(),
mt_field='project',
style={'base_template': 'input.html'},
)

class Meta:
Expand All @@ -177,6 +180,7 @@ class AttachmentSerializer(DynamicFieldsMixin, DynamicFieldsModelSerializer):
submission = MtPrimaryKeyRelatedField(
queryset=models.Submission.objects.all(),
mt_field='project',
style={'base_template': 'input.html'},
)

class Meta:
Expand Down Expand Up @@ -237,6 +241,11 @@ class SchemaDecoratorSerializer(DynamicFieldsMixin, DynamicFieldsModelSerializer

project = MtPrimaryKeyRelatedField(
queryset=models.Project.objects.all(),
style={'base_template': 'input.html'},
)
schema = serializers.PrimaryKeyRelatedField(
queryset=models.Schema.objects.all(),
style={'base_template': 'input.html'}
)

class Meta:
Expand Down Expand Up @@ -323,21 +332,25 @@ class EntitySerializer(DynamicFieldsMixin, KernelBaseSerializer):
project = MtPrimaryKeyRelatedField(
queryset=models.Project.objects.all(),
required=False,
style={'base_template': 'input.html'},
)
submission = MtPrimaryKeyRelatedField(
queryset=models.Submission.objects.all(),
mt_field='mappingset__project',
required=False,
style={'base_template': 'input.html'},
)
mapping = MtPrimaryKeyRelatedField(
queryset=models.Mapping.objects.all(),
mt_field='mappingset__project',
required=False,
style={'base_template': 'input.html'},
)
schemadecorator = MtPrimaryKeyRelatedField(
queryset=models.SchemaDecorator.objects.all(),
mt_field='project',
required=False,
style={'base_template': 'input.html'},
)

def create(self, validated_data):
Expand Down Expand Up @@ -474,6 +487,7 @@ class SubmissionSerializer(DynamicFieldsMixin, KernelBaseSerializer):
project = MtPrimaryKeyRelatedField(
queryset=models.Project.objects.all(),
required=False,
style={'base_template': 'input.html'},
)

is_extracted = serializers.BooleanField(default=False)
Expand All @@ -482,6 +496,7 @@ class SubmissionSerializer(DynamicFieldsMixin, KernelBaseSerializer):
queryset=models.MappingSet.objects.all(),
mt_field='project',
required=False,
style={'base_template': 'input.html'},
)

def create(self, validated_data):
Expand Down
2 changes: 2 additions & 0 deletions aether-odk-module/aether/odk/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class MediaFileSerializer(DynamicFieldsMixin, DynamicFieldsModelSerializer):
xform = MtPrimaryKeyRelatedField(
queryset=XForm.objects.all(),
mt_field='project',
style={'base_template': 'input.html'},
)

class Meta:
Expand Down Expand Up @@ -92,6 +93,7 @@ class XFormSerializer(DynamicFieldsMixin, DynamicFieldsModelSerializer):

project = MtPrimaryKeyRelatedField(
queryset=Project.objects.all(),
style={'base_template': 'input.html'},
)

def validate(self, value):
Expand Down
3 changes: 2 additions & 1 deletion aether-ui/aether/ui/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ class PipelineSerializer(DynamicFieldsMixin, DynamicFieldsModelSerializer):
is_read_only = serializers.BooleanField(read_only=True)

project = MtPrimaryKeyRelatedField(
required=False,
queryset=models.Project.objects.all(),
required=False,
style={'base_template': 'input.html'},
)

def create(self, validated_data):
Expand Down

0 comments on commit 7344a3a

Please sign in to comment.