Skip to content
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

Path to view on error or warning #866

Closed
HansAarneLiblik opened this issue Nov 22, 2022 · 3 comments · Fixed by #889
Closed

Path to view on error or warning #866

HansAarneLiblik opened this issue Nov 22, 2022 · 3 comments · Fixed by #889

Comments

@HansAarneLiblik
Copy link

HansAarneLiblik commented Nov 22, 2022

Not a bug, but rather a feature-request

When generating the schema and there are errors for some views, it is difficult to track down the view as there may be views with same name in multiple apps

Error #0: task_list: unable to guess serializer. ...

It would be really great, if the path to the view was also printed out, e.g. url from self.path or somehow the full filepath myapp/views.py

Error #0: task_list: unable to guess serializer. ... Ignoring view for now (myapp/app1/views.py)
...
Error #12: task_list: unable to guess serializer. ... Ignoring view for now (myapp/app4/views.py)
@tfranzel
Copy link
Owner

Hey @HansAarneLiblik, that is an interesting suggestion. Certainly useful for people migrating and having lots of warnings.

The meat of the matter lies here:

def add_trace_message(trace_message):

with add_trace_message(filterset_class.__name__):

with add_trace_message(getattr(view, '__class__', view).__name__):

I'm open to suggestions on how to make this work.

@HansAarneLiblik
Copy link
Author

I created a PR #868

Don't really know how I feel about the duplication of _TRACES logic though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants