Open pleveau opened 10 years ago
Hey, thanks for the report.
It seems that we need to handle OneToOneField
with special care... I can't remember on the top of my head where the related_field could be on such a field but it is probably defined somewhere else.
Do you mind giving it a go and try to fix it ? That would be awesome as I don't have much time to spend writing code for this project nowadays.
Thx !
Hi, I'm looking into this.
Something seems to be wrong, though. From your stack trace, the error seems to originate from tastypie_swagger/mapping.py:77. That line does not seem to correspond to the return statement at all, either in the ref you quoted, or in the current master branch.
Worse, I can't find code that even looks like that in either of these refs. I can find the line self.resource_pk_type = self.get_pk_type()
, but that references a function that doesn't look like the one in the final line of that stack trace.
Am I missing something?
Hello, I found this issue when trying tastypie swagger on some Resources created from inherited models. This may be more general and related to the handling of OneToOne fields...
Here is the code:
and the traceback:
Using tastypie v 0.11.1 and tastypie-swagger master (sha 3d3b2b42a867fe60b2b204e06142e5164fe9e0b6) . Resource that are related to parent models (SampleModel in the example) are working fine.
Thanks for all the good work!