Last active
February 9, 2018 06:01
-
-
Save Nipun2016/3990df99d9a649215a8950b2d396e9bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
content_type = ContentType.objects.get_for_model(MODEL_NAME) | |
// primary key of the object in this case it was the project id | |
object_id = current_project.pk | |
FileAttachment.objects.create(content_type=content_type, | |
object_id=object_id, | |
file_type='project_image', | |
attachment_file=request.FILES.get('project_image')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment