How can I get current logged user profile in django, into models ?
I have this code:
def save(self, *args, **kwargs):
profile = User.get_profile()
self.empresa_id = profile.idempresa
self.empresa_id = profile.id_comerx3c
super(Cliente, self).save(*args, **kwargs)
but doesn`t work..
If you're using a ModelForm, you have three choices:
If you're just dealing with a Model, you have two choices:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.