cover = models.ImageField(upload_to='covers', null=False)
def get_path_file(instance, filename):
category = instance.category.name
name = instance.name
return os.path.join('products_images', category, name[:25], filename)
cover = models.ImageField(upload_to=get_path_file, null=False)