我对django的tastypie很陌生。我有一个组织模式。在api.py公司你知道吗
class OrganisationResource(ModelResource):
create_user = fields.ForeignKey(PersonResource, 'create_user', null=True, full=True)
update_user = fields.ForeignKey(PersonResource, 'update_user', null=True, full=True)
location = fields.ForeignKey(LocationResource, 'location', null=True, full=True)
class Meta:
allowed_methods = ['post','get','delete','patch','put']
queryset = Organization.objects.all()
resource_name = 'organisation'
authorization = Authorization()
authentication = Authentication()
always_return_data = True
api url是
http://127.0.0.1:8000/api/v1/organisation/
对上述链接的post请求正在将该数据保存到数据库中。但我的疑问是,我是否可以使用一个单独的链接发布或覆盖当前的网址,以便我可以发送后的要求,该链接。就像
http://127.0.0.1:8000/api/v1/organisation/create
您可以使用
prependurls
有用的link为文章创建单独的url相关问题 更多 >
编程相关推荐