1
django-tastypie를 사용하여 장고 모델을 노출하고 있습니다. 그러나이 리소스에 게시하는 데 몇 가지 문제가 있습니다. tastypie는 'id'필드 외에도 다른 기본 필드를 사용하고있는 것을 좋아하지 않습니다.Tastypie가 ID가 아닌 기본 키로 게시 할 수 없습니다.
"error_message": "Reverse for 'api_dispatch_detail' with arguments '()' and keyword arguments '{'pk': u'VMware-42 30 21 91 31 77 1b 8a-75 c1 4f ab 70 d9 99 a6', 'api_name': 'v1', 'resource_name': 'system'}' not found.",
내 모델 :
class System(models.Model):
selinux = models.CharField(max_length=255)
serialnumber = models.CharField(primary_key=True, max_length=255)
signer = models.CharField(max_length=255)
tsm_pvu = models.CharField(max_length=255)
내 자원 :
class SystemResource(ModelResource):
class Meta:
queryset = System.objects.all()
authentication = ApiKeyAuthentication()
authorization = DjangoAuthorization()
resource_name = 'system'
+1 패치를 제공해 주셔서 감사합니다. –