jmcarp / nplusone

Auto-detecting the n+1 queries problem in Python
MIT License
996 stars 47 forks source link

Ignore by URL prefixes #24

Closed sobolevn closed 6 years ago

sobolevn commented 6 years ago

I am using django with a lot of 3d party apps, like: django-filer, django-axes, reversion, and may others. I like to be notified about potential problems with exceptions.

I would like to ignore a lot of errors inside my admin panel. But, since I can't and do not want to fix issues with 3d party plugins, I would like to ignore some urls:

Can you consider adding such feature?

jmcarp commented 6 years ago

I'd be open to this feature, but I want to understand the problem better first. We already support ignoring errors by model, like this: https://github.com/jmcarp/nplusone#ignoring-notifications. Would it be possible to ignore models from these libraries, or would that be inconvenient or impossible to do?

Also, it would be useful if you could include output from a failing test.

sobolevn commented 6 years ago

On the other second thought, I guess this feature is not required.

I have just created a long list of models as a whitelist in the end. But that was a big list! Two way of ignoring something might cause hidden problems and confusion.

Thank you for quick response.

jmcarp commented 6 years ago

I was thinking about the use case of whitelisting many related models and added the ability to whitelist models by fnmatch pattern. You should now be able to whitelist all models from a package with somepackage.*.

sobolevn commented 6 years ago

@jmcarp great! thanks!