Exemple #1
0
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])
Exemple #2
0
def project_image_name(instance, filename):
    fn, ext = filename.split('.',1)
    fn = new_slugify(fn) + '.' + ext
    return '/'.join(['projects', instance.slug, fn])
Exemple #3
0
def author_avatar_name(instance, filename):
    fn, ext = filename.split('.',1)
    fn = new_slugify(fn) + '.' + ext
    return '/'.join(['authors', instance.nickname, fn])
Exemple #4
0
def post_image_name(instance, filename):
    fn, ext = filename.split('.',1)
    fn = new_slugify(fn) + '.' + ext
    return '/'.join(['news', fn])
Exemple #5
0
 def slugify(self,tag,i=None):
     return new_slugify(tag)
Exemple #6
0
def upload_to(instance,filename):
  fn, ext = filename.split('.',1)
  fn = new_slugify(fn) + '.' + ext
  return os.path.join('django-summernote', fn)