I created a new model inside xblock-sdk/models.py file called scenarios with multiple fields and then serialized them so i can access them using django rest framwork,
#models.py
class Scenarios(models.Model):
description = models.TextField()
XBlock_id = models.CharField(max_length=100)
def __repr__(self):
return u"<description={self.scenario} " \
"XBlock_id={self.scenario_id}>".format(self=self)
#serializer.py
class xblockSerializer(serializers.ModelSerializer):
class Meta:
model = Scenarios
fields = '__all__'
the purpose is to get all the data about the available xblocks. however when i access the url in django rest framework i find an empty response which seems to be logic because i only created a model and i didn't populate it with the available xblocks data.
my question is what should i do in order to get a response with the data about the xblocks.