79133574

Date: 2024-10-28 13:22:04
Score: 1.5
Natty:
Report link

I understand you want to customize Summernote's upload path to include the user ID instead of the date. The error occurs because the attachment_upload_to function receives different parameters than what you're expecting. Let me help you fix this. This are steps you can follow to solve problem

1.Creates a custom attachment model that includes user information 2.Modifies the upload path to include the user ID 3.Ensures the user information is available during file upload 4.Maintains the UUID-based filename for uniqueness 5.Provides a fallback for anonymous uploads

The files will now be saved in paths like:

ProjectName/media/django-summernote/User100/uuid-filename.png ProjectName/media/django-summernote/User200/uuid-filename.jpg

Remember to handle any existing files and migrations carefully if you're implementing this in a project that already has uploaded files.

if need any code snippet ,reach me; I will provide detailed code but I assure that above code will works ,cause its work for my domain !

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • User mentioned (1): User100
  • User mentioned (0): User200
  • Low reputation (1):
Posted by: Jeet