Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WIP] Fix example app #362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
mblayman merged 3 commits into django-json-api:develop from AstraLuma:fix-example
Oct 11, 2017
Merged

Conversation

Copy link
Contributor

@AstraLuma AstraLuma commented Jun 30, 2017
edited
Loading

Some miscellaneous bugs, some of which stemmed from polymorphic. Fixes #356

  • The example now requires packaging (example/serializers.py). I'm guessing this is the actual cause of the bug.
  • /entries produces ImproperlyConfigured at /entries: Could not resolve URL for hyperlinked relationship using view name "entry-relationships".
  • /projects produces AttributeError at /projects: 'list' object has no attribute '_meta'

Copy link

codecov-io commented Jun 30, 2017
edited
Loading

Codecov Report

Merging #362 into develop will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@ Coverage Diff @@
## develop #362 +/- ##
===========================================
+ Coverage 92.81% 92.86% +0.05% 
===========================================
 Files 51 51 
 Lines 2644 2650 +6 
===========================================
+ Hits 2454 2461 +7 
+ Misses 190 189 -1
Impacted Files Coverage Δ
example/tests/integration/test_polymorphism.py 100% <100%> (ø) ⬆️
rest_framework_json_api/serializers.py 84.89% <100%> (+0.71%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1659d8c...95bfebe. Read the comment docs.

Copy link
Contributor Author

@leo-naeka if you know this better, I would love some insight. I'm not actually that familiar with DRF.

Copy link
Contributor

I'll check this today.

Copy link
Contributor

Actually the ImproperlyConfigured at /entries: Could not resolve URL for hyperlinked relationship using view name "entry-relationships". bug was introduced before the polymorphic feature merge: occurs in 629d1d6.

The last error is polymorphic-related indeed.

Copy link
Collaborator

mblayman commented Jul 3, 2017

@Darkheir, one of the errors that's happening on the demo site might be related one of your commits. Could you take a look at the issue? Once we fix the demo site, I'd love to put out a release that includes everyone's work from the last couple of months.

Copy link
Contributor

Darkheir commented Jul 3, 2017

Hi,

I quickly checked using the debugger and the code I added is not called during the process ...

Copy link
Contributor

leo-naeka commented Jul 3, 2017
edited
Loading

After some investigation this endpoint may have been errored since Nov. 8th 2016 with commit 1941c34.

  • 1941c34 introduced the Could not resolve URL for hyperlinked relationship using view name "entry-relationships".
  • fbe49a1 introduced the 'EntrySerializer' object has no attribute 'partial' error which supersede 1941c34's one but occurred only with DRF>=3.6.3
  • a12d98d fixed the 'EntrySerializer' object has no attribute 'partial' and we got back the first one 'til now...

Copy link
Contributor

The fact is that relationship patterns are not included in regular urls.py as they are in urls_test.py. I'm not very familiar with the relationships code, but adding them seems to fix the bug...

Copy link
Contributor

@astronouth7303 found the bug in the PolymorphicModelSerializer causing the last error. Fixed and added a test case locally. Could you please grant me push to your repo in order to fix all of these in this PR?

AstraLuma and leo-naeka reacted with thumbs up emoji

Copy link
Contributor

@mblayman @astronouth7303 @jsenecal any thoughts on this? In particular the second error and the missing relationship patterns in urls.py? @astronouth7303 the last error has been fixed, so should be checked on the OP.

Copy link
Collaborator

mblayman commented Jul 6, 2017

@leo-naeka I won't have much time to look at this for a while, but I hope to give it some more time in the future. I took a quick peek and I have a question. What do you mean by "missing relationship patterns"? The second bullet is an error with /entries and it looks like that is in urls.py. I'm not clear on your meaning of "missing" in this context.

btw, thanks for looking into these issues!

Copy link
Contributor

This is an error with theentry-relationships endpoint which is not part of the entries viewset.
This is only defined in urls_test.py [code] but missing in urls.py [code]

I guess this is why tests aren't failing whereas demo does.

Copy link
Collaborator

Could we solve the remaining problems by moving the routes from the tests to the regular urls.py file? I think this branch has made things better and if moving the routes is something that would fix the demo site, then I think that would be good enough to merge so we can get closer to releasing.

Copy link
Collaborator

Time flies. I think this code is good enough to merge because it solved some problem. Since there hasn't been movement on the remaining task, I'll merge and we can solve that later.

@mblayman mblayman merged commit 2d691f4 into django-json-api:develop Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /