Improve the type detection and better support for django admin