For Chinese programmers,it's money

Tanjina Sharmin <tanjinasharmin1...@gmail.com> 于2021年9月3日周五 下午8:25写道:

> def path_and_renamecsv(instance, filename):
> upload_to = 'attendancesheet'
> ext = filename.split('.')[-1]
> # get filename
> if instance.pk:
> filename = '{}.{}'.format(instance.pk, ext)
> else:
> # set filename as random string
> filename = '{}.{}'.format(uuid4().hexq, ext)
> # return the whole path to the file
> return os.path.join(upload_to, filename)
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/cc8c6fbc-2d66-49eb-80c5-4e8b85d66e34n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/cc8c6fbc-2d66-49eb-80c5-4e8b85d66e34n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAE1PWw78w7F0nunYdBHauQgo3F2AEjHATOx8R%3DiNPn5HnXPxA%40mail.gmail.com.

Reply via email to