The code I’m looking at is from django.contrib.auth.models.User
def _get_message_set(self):
import warnings
warnings.warn('The user messaging API is deprecated. Please update'
' your code to use the new messages framework.',
category=DeprecationWarning)
return self.**_message_set**
message_set = property(_get_message_set)
–where the devil is this _message_set field?
I suspect something of the automatic sort is happening here, but I’m not sure.
In Python, an attribute of an object does not need to be declared. In your case, it’s set up in the constructor of the superclass
models.Model.Note that the internal attribute is prefixed with an underscore, whereas the external one (which happens to be a property) lacks one.