Dodanie katalogów files i media do .gitignore.
[redakcja.git] / apps / explorer / models.py
1 import os
2
3 from django.conf import settings
4
5
6 def get_image_folders():
7     return [fn for fn in os.listdir(settings.IMAGE_DIR) if not fn.startswith('.')]
8
9
10 def get_images_from_folder(folder):
11     return ['/media/images/' + folder + '/' + fn for fn 
12             in os.listdir(os.path.join(settings.IMAGE_DIR, folder))
13             if not fn.startswith('.')]
14