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
|
||||
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)
|
||||
|
||||
class Meta:
|
||||
fields = list()
|
||||
model = models.Report
|
||||
|
||||
if model.submitted:
|
||||
fields = (
|
||||
'user_id',
|
||||
'title',
|
||||
'date_created',
|
||||
'data_submitted',
|
||||
'submitted',
|
||||
)
|
||||
else:
|
||||
fields = (
|
||||
'user_id',
|
||||
'title',
|
||||
'date_created',
|
||||
# 'data_submitted',
|
||||
'submitted',
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue