Skip to content

Instantly share code, notes, and snippets.

View CaioEuzebio's full-sized avatar
🎯
Focusing

Caio Euzébio CaioEuzebio

🎯
Focusing
View GitHub Profile
@fabiomontefuscolo
fabiomontefuscolo / models.py
Created January 9, 2012 19:20
Let the Django FileField overwrite files with the same name
# -*- coding: utf-8 -*-
from django.conf import settings
from django.core.files.storage import FileSystemStorage
from django.db import models
class OverwriteStorage(FileSystemStorage):
'''
Muda o comportamento padrão do Django e o faz sobrescrever arquivos de
mesmo nome que foram carregados pelo usuário ao invés de renomeá-los.
'''