Anfänglicher Commit: Producion Version Stand: Oktober 2014

This commit is contained in:
Christian Berg
2014-11-25 23:43:21 +01:00
commit daa35f5913
3381 changed files with 132346 additions and 0 deletions

31
src/utils/__init__.py Normal file
View File

@@ -0,0 +1,31 @@
'''
Created on 28.09.2011
@author: christian
'''
from .countries import COUNTRIES
from .html_cleaner import HtmlCleaner
from .massmailer import MassMailer
from django.core.files.storage import FileSystemStorage
from django.utils.translation import ugettext as _
STATUS_REJECTED, STATUS_WAITING, STATUS_PUBLISHED = -1, 0, 1
STATUS_CHOICES = (
(STATUS_REJECTED, _('Rejected')),
(STATUS_WAITING, _('Waiting...')),
(STATUS_PUBLISHED, _('Published')),
)
cleaner = HtmlCleaner()
class OverwriteStorage(FileSystemStorage):
"""
Returns same name for existing file and deletes existing file on save.
"""
def _save(self, name, content):
if self.exists(name):
self.delete(name)
return super(OverwriteStorage, self)._save(name, content)
def get_available_name(self, name):
return name