Support Django 1.5 custom user models

Thanks to ondrowan, reinspijkerman, bmease, and lukashed for contributions.
resolve merge conflicts
Changed getattr to hasattr to avoid DoesNotExist exception from being raised when Resource fields are missing.