In Django project i get two objects when i receive the JSON response
data.meta
and data.objects
This is my Resource
class MyResource(ModelResource):
def dehydrate(self, bundle):
bundle.data["absolute_url"] = bundle.obj.get_absolute_url()
bundle.data['myfields'] = MyDataFields
return bundle
class Meta:
queryset = MyData.objects.all()
resource_name = 'weather'
serializer = Serializer(formats=['json'])
ordering = MyDataFields
now i want to other field in json like
data.myfields
but if i do the above way then that field is added to every object like
data.objects.myfields
how can i do data.myfields
data['extent'] = self._meta.queryset.extent()
– Chiropteran