0
这里是我的tastypie代码片段。Django tastypie,如何访问由ModelResource类中的post_list创建的对象
class MycustomeResource(ModelResource):
asdf = fields.IntegerField('asdf', null=True)
adsfasd = fields.IntegerField('adsfasd')
class Meta:
always_return_data = True
queryset = Mycustome.objects.all()
def post_list(self, request, **kwargs):
object_temp = super(MycustomeResource, self).post_list(request, **kwargs)
return object_temp
这里post_list
正在对对象,我希望这样的对象,这样我就可以在其上进行操作。
是否需要覆盖obj_create
才能获得对象..?
好的,谢谢你,在这里写这篇obj_create功能? – RMK 2014-11-07 03:27:17
在您的modelResource中。 – 2014-11-07 10:30:45