You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not necessarily a django-apm specific question, but hopefully someone here has some thoughts... I've implemented class based views in my Django project and I want to add some pre-commit checking to make sure that those views (and future views) all inherit from ApmView. I have written a check for function based views using inspect.getsource to confirm that the @apm_view() decorator is present - but I'm struggling to validate for these class based views.
Any thoughts or direction would be appreciated. Thanks!
The text was updated successfully, but these errors were encountered:
Hey there!
That may depends on your current "check" implementation. If you're using flake8, you can use AST to check the view definition.
At runtime, we don't do anything on the view being decorated (for function-based views), or being subclassed (for class-based views), only on the request before your code.. so in this case i think it may be a bit hard to introspect the view to find out.
This is not necessarily a django-apm specific question, but hopefully someone here has some thoughts... I've implemented class based views in my Django project and I want to add some pre-commit checking to make sure that those views (and future views) all inherit from
ApmView
. I have written a check for function based views usinginspect.getsource
to confirm that the@apm_view()
decorator is present - but I'm struggling to validate for these class based views.Any thoughts or direction would be appreciated. Thanks!
The text was updated successfully, but these errors were encountered: