Hi,

Do you know a custom field for a callable python object like a Class or a 
function ?

It could store it as a string in the DB: "module1.module2.class"  or   
"module1.module2.function"
With that string, it could load it as a real python object when you get it 
from the DB.

For example, you could do something like that:

from module1.module2 import testme
mymodel.process = testme
mymodel.save() => stores the string "module1.module2.testme"

# Later...
ins = mymodel.objects.get(..)
ins.process('OK') # ins.process can be called because it has been resolved 
to the testme function

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/sHDfKCKGBmEJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to