[Answer]-How can I get current logged user profile in django, into models?

1👍

If you’re using a ModelForm, you have three choices:

  1. Set the profile when you instantiate the form
  2. Create the object instance in a view, but not commit it, then set the profile property and
    commit the save
  3. Pass the profile to the save method, and set the property before
    calling super

If you’re just dealing with a Model, you have two choices:

  1. Pass the profile in when you instantiate the object
  2. Set the profile on an instance of your object before you call save

Leave a comment