def topic_image_name(instance, filename): fn, ext = filename.split('.',1) fn = new_slugify(fn) + '.' + ext return '/'.join(['topics', new_slugify(instance.topic_name), fn])
def project_image_name(instance, filename): fn, ext = filename.split('.',1) fn = new_slugify(fn) + '.' + ext return '/'.join(['projects', instance.slug, fn])
def author_avatar_name(instance, filename): fn, ext = filename.split('.',1) fn = new_slugify(fn) + '.' + ext return '/'.join(['authors', instance.nickname, fn])
def post_image_name(instance, filename): fn, ext = filename.split('.',1) fn = new_slugify(fn) + '.' + ext return '/'.join(['news', fn])
def slugify(self,tag,i=None): return new_slugify(tag)
def upload_to(instance,filename): fn, ext = filename.split('.',1) fn = new_slugify(fn) + '.' + ext return os.path.join('django-summernote', fn)