Skip to content

Commit

Permalink
Merge pull request #2 from MohamedHamed12/hamed
Browse files Browse the repository at this point in the history
Hamed
  • Loading branch information
MohamedHamed12 authored Apr 21, 2024
2 parents 04263e6 + 8d7780d commit c437266
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
16 changes: 10 additions & 6 deletions project/accounts/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,30 @@
class PhoneSerializer(serializers.ModelSerializer):
class Meta:
model = Phone
fields = '__all__'
# fields = '__all__'
exclude = ['is_deleted']
class AddressSerializer(serializers.ModelSerializer):
class Meta:
model = Address
fields = '__all__'
# fields = '__all__'
exclude = ['is_deleted']
class PatientSerializer(serializers.ModelSerializer):
class Meta:
model = Patient
fields = '__all__'

# fields = '__all__'
exclude = ['is_deleted']


class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
fields = '__all__'
# fields = '__all__'
exclude = ['is_deleted']
class DoctorSerializer(serializers.ModelSerializer):
class Meta:
model = Doctor
fields = '__all__'
# fields = '__all__'
exclude = ['is_deleted']
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
Expand Down
6 changes: 3 additions & 3 deletions project/project/utls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ def get_schema(self, request=None, public=False):

schema_view = get_schema_view(
openapi.Info(
title="Snippets API",
title="Hospital APIs",
default_version='v1',
description="Test description",
description="APIs for Hospital App to manage patient data and visit data",
terms_of_service="https://www.google.com/policies/terms/",
contact=openapi.Contact(email="contact@snippets.local"),
contact=openapi.Contact(email="test.com"),
license=openapi.License(name="BSD License"),
),
public=True,
Expand Down
9 changes: 6 additions & 3 deletions project/visit/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class Attachment(models.Model):
class VisitSerializer(serializers.ModelSerializer):
class Meta:
model = Visit
fields = '__all__'
# fields = '__all__'
exclude = ['is_deleted']
def to_representation(self, instance):
data= super().to_representation(instance)
messurement=Measurement.objects.filter(visit=data['id'])
Expand All @@ -26,8 +27,10 @@ def to_representation(self, instance):
class MeasurementSerializer(serializers.ModelSerializer):
class Meta:
model = Measurement
fields = '__all__'
# fields = '__all__'
exclude = ['is_deleted']
class AttachmentSerializer(serializers.ModelSerializer):
class Meta:
model = Attachment
fields = '__all__'
# fields = '__all__'
exclude = ['is_deleted']

0 comments on commit c437266

Please # to comment.