Hi,
class AddressSerializer(serializers.ModelSerializer):
class Meta:
model = Address
class CategorySerializer(serializers.ModelSerializer):
class Meta:
model = Category
class BusinessSerializer(serializers.ModelSerializer):
class Meta:
model = Business
exclude = ['date_added', 'date_modified',]
* data = BusinessHour.objects.filter(business=)*
address = AddressSerializer(many=False, read_only=True)
category = CategorySerializer(many=False, read_only=True)
business_hours = BusinessHourSerializer(data=data)
I want to query the businesshour by current business. BusinessHour has a
foreign key Business so i should be able to use it to get only the business
hour of that business.
How do I get the current object
--
You received this message because you are subscribed to the Google Groups
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.