def determine_media_upload_path(instance, filename): if instance.is_video(): fmt = "videos/projects/%(partition)d/%(filename)s" else: fmt = "images/projects/%(partition)d/%(filename)s" return fmt % { 'partition': get_partition_id(instance.project.pk), 'filename': safe_filename(filename), }
def determine_upload_path(instance, filename): chunk_size = 1000 # max files per directory return "images/badges/%(partition)d/%(filename)s" % { 'partition': get_partition_id(instance.pk, chunk_size), 'filename': safe_filename(filename), }
def determine_image_upload_path(instance, filename): return "images/projects/%(partition)d/%(filename)s" % { 'partition': get_partition_id(instance.pk), 'filename': safe_filename(filename), }
def determine_upload_path(instance, filename): chunk_size = 1000 # max files per directory return "images/profiles/%(partition)d/%(filename)s" % { 'partition': get_partition_id(instance.pk, chunk_size), 'filename': safe_filename(filename), }