On Thursday, February 20, 2014 6:23:27 PM UTC-4:30, Antonio Villavicencio wrote: > > 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. >
Should you append 'choices' to the list? Regards, Camilo. -- 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/9009490e-04c7-4031-908f-b3be4296fbde%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.

