fix errors
This commit is contained in:
parent
fe516ec96b
commit
496ec5626e
1 changed files with 8 additions and 19 deletions
|
@ -8,26 +8,15 @@ from . import models
|
||||||
|
|
||||||
# serializer for reports
|
# serializer for reports
|
||||||
class ReportSerializer(serializers.ModelSerializer):
|
class ReportSerializer(serializers.ModelSerializer):
|
||||||
# user id is foreign key...? fix this
|
# user id is foreign key
|
||||||
user_id = serializers.PrimaryKeyRelatedField(many=False, read_only=True)
|
user_id = serializers.PrimaryKeyRelatedField(many=False, read_only=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
fields = list()
|
|
||||||
model = models.Report
|
|
||||||
|
|
||||||
if model.submitted:
|
|
||||||
fields = (
|
|
||||||
'user_id',
|
|
||||||
'title',
|
|
||||||
'date_created',
|
|
||||||
'data_submitted',
|
|
||||||
'submitted',
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
fields = (
|
fields = (
|
||||||
'user_id',
|
'user_id',
|
||||||
'title',
|
'title',
|
||||||
'date_created',
|
'date_created',
|
||||||
|
# 'data_submitted',
|
||||||
'submitted',
|
'submitted',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue