I would like to define a Python property outside of a class definition:
c = C() c.user = property(lambda self: User.objects.get(self.user_id)) print c.u
Object instances like c cannot have properties; only classes like C can have properties. So you need to set the property on the class, not the instance, because Python only looks for it on the class:
c
C
C.user = property(lambda self: User.objects.get(self.user_id))