I am trying just to do an API REST with the project of:
https://docs.djangoproject.com/en/dev/intro/tutorial01/
specifically with the model of Question
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
class Choice(models.Model):
question = models.ForeignKey(Question)
choice_text = models.CharField(max_length=200)
votes = models.IntegerField(default=0)
I want to apply a serializer with question's choices but I don't know how
to do it
class QuestionSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Question
fields = (*'id', 'question_text'*, ????? )
I need some suggestion to solve this problem.
thanks in advance
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/a2b02a3d-f5bf-4a78-b848-48b0e076d5f3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.