Files
dss/spa/api/v1/ReleaseAudioResource.py
Fergal Moran 50c9e4e8c1 Removed userfollows model and changed to ForeignKey properties in UserProfile
Migrations got a bit borked so doing this commit to stage the migrations in live as I don't want to have a massive, potentially dangerous, migration.
2013-04-30 23:26:42 +01:00

17 lines
600 B
Python

from tastypie import fields
from spa.api.v1.BackboneCompatibleResource import BackboneCompatibleResource
from spa.models.release import ReleaseAudio
class ReleaseAudioResource(BackboneCompatibleResource):
release = fields.ToOneField('spa.api.v1.ReleaseResource.ReleaseResource', 'release')
class Meta:
queryset = ReleaseAudio.objects.all()
resource_name = 'audio'
filtering = {
"release": ('exact',),
}
def dehydrate(self, bundle):
bundle.data['waveform_url'] = bundle.obj.get_waveform_url()
return bundle