Created
September 18, 2012 20:30
-
-
Save hughes/3745668 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dehydrate_images(self, bundle): | |
images = OfferImage.objects.filter(offer=bundle.obj.pk) | |
resource = OfferImageResource() | |
result = [] | |
for image in images: | |
bundle = resource.build_bundle(obj=image, request=bundle.request) | |
data = resource.full_dehydrate(bundle).data | |
data["resource_uri"] = resource.get_resource_uri(image) | |
result.append(data) | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment