Django REST Framework: Felder in verschachteltem Objekt definieren?

Ich habe Ereignisse, die an folgenden Orten stattfinden:

class Event(models.Model):
    title = models.CharField(max_length=200)
    date_published = models.DateTimeField('published date',default=datetime.now, blank=True)
    date_start = models.DateTimeField('start date')
    date_end = models.DateTimeField('end date')
    def __unicode__(self):
        return self.title
    description = models.TextField()
    price = models.IntegerField(null=True, blank=True)
    tags = TaggableManager()
    location = models.ForeignKey(Location, blank=False)

class Location(models.Model):
    location_title = models.CharField(max_length=200)
    location_date_published = models.DateTimeField('published date',default=datetime.now, blank=True)
    location_latitude = models.CharField(max_length=200)
    location_longitude = models.CharField(max_length=200)
    location_address = models.CharField(max_length=200)
    location_city = models.CharField(max_length=200)
    location_zipcode = models.CharField(max_length=200)
    location_state = models.CharField(max_length=200)
    location_country = models.CharField(max_length=200)
    location_description = models.TextField()
    def __unicode__(self):
        return u'%s' % (self.location_title)

Ich kann die Ergebnisse von allen erhalten über:

class EventSerializer(serializers.HyperlinkedModelSerializer):
    id = serializers.Field()
    class Meta:
        model = Event
        depth = 2
        fields = ('url','id','title','date_start','date_end','description', 'price', 'location')

Welche Ausgänge:

 {
            "url": "http://localhost:8000/api/event/3/", 
            "id": 3, 
            "title": "Testing", 
            "date_start": "2013-03-10T20:19:00Z", 
            "date_end": "2013-03-10T20:19:00Z", 
            "description": "fgdgdfg", 
            "price": 10, 
            "location": {
                "id": 2, 
                "location_title": "Mighty", 
                "location_date_published": "2013-03-10T20:16:00Z", 
                "location_latitude": "37.767475", 
                "location_longitude": "-122.406878", 
                "location_address": "119 Utah St, San Francisco, CA 94103, USA", 
                "location_city": "San Francisco", 
                "location_zipcode": "94103", 
                "location_state": "California", 
                "location_country": "United States", 
                "location_description": "Some place"
            }
        }, 

Ich möchte jedoch nicht, dass es alle Felder erfasst, da ich nicht alle benötige. Wie kann ich definieren, welche Felder von meinem verschachtelten Objekt abgerufen werden sollen? Vielen Dank!

Antworten auf die Frage(3)

Ihre Antwort auf die Frage