Public
Authored by 💻

Import any python callback

Currently with django we can only import an attribute from a module, not a sub-attribute. For example

import_string('foo.models.YourModel')  # works
import_string('foo.models.YourModel.objects.update_stats')  # doesn't

This snippet fixes that, originally for django-call.

import_callback.py 528 Bytes
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment