title: Tastypie - Accessing Field Data Through ForeignKey Field
body: <p>I have a Tastypie resource (TaskImagesResource) which needs to override the obj_get_list function to return the correct data when a request is made to the API. I need to access properties of another resource (TaskResource, which has a OneToOne relationship with TaskImagesResource) in order to do this. I can get an instance of the Task resource using get_related_resource() but I don't know how to get data out of the object. Here is my code now:</p>
  
  <pre><code>class TaskResource(ModelResource):
      target = fields.OneToOneField(TargetResource, 'target', full=True)
      activity = fields.ForeignKey(ActivityResource, 'activity')
      time = fields.OneToOneField(TaskEventTimeResource, 'time', full=True)
  
      class Meta:
          queryset = Task.objects.all()
          filtering = {
              'id' : ALL,
              'activity' : ALL_WITH_RELATIONS,
       }
  
  class TaskImagesResource(Resource):
      task = fields.ForeignKey(TaskResource, 'task', full=True)
      camera = fields.CharField()
  
      def obj_get_list(self, request, **kwargs):
          task_resource = self.task.get_related_resource(self)
          task = Task.objects.get(id=task_resource.id)
          image_list = task.sorted_imageinstances(self.camera)
  </code></pre>
  
  <p>But I'm getting the error "int() argument must be a string or a number, not 'CharField'" because task_resource.id is a CharField object and not the data itself. How can I access the actual Field data?</p>