I have a property in a Django Model that I\'d like to expose via a TastyPie ModelResource.
My Model is
class UserProfile(models.Model):
_genderChoic
A full example with dehydrate:
class UserResource(ModelResource):
fullname = fields.CharField(readonly=True)
class Meta:
queryset = auth_models.User.objects.all()
resource_name = 'user'
def dehydrate_fullname(self, bundle):
return u"{first_name} {last_name}".format(
first_name=bundle.obj.first_name, last_name=bundle.obj.last_name)