Skip to content

Instantly share code, notes, and snippets.

View yakky's full-sized avatar
🐢
trying to catch up with maintainer duties

Iacopo Spalletti yakky

🐢
trying to catch up with maintainer duties
View GitHub Profile
@yakky
yakky / fix.py
Created August 26, 2012 10:53
Migration script for django-filer pre 0.9a3
def fix_dev_path():
from filer.models import File
import sys
for f in File.objects.filter(is_public=True):
sys.stdout.write(u'moving %s to public storage... ' % f.id)
f.is_public = False
f.file.name = "filer/%s" % f.file.name
f.save()
f.is_public = True
f.save()
@yakky
yakky / Tutorial settings file
Created August 17, 2012 07:29
Tutorial settings file
# -*- coding: utf-8 -*-
import os
gettext = lambda s: s
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
@yakky
yakky / settings.py
Created July 14, 2012 16:57
Windows settings
# Django settings for cms13 project.
import os
gettext = lambda s: s
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
@yakky
yakky / migrate_filer.py
Created July 12, 2012 11:42 — forked from iivvoo/migrate_filer.py
migrate "traditional" image fields to FilerImageField
# encoding: utf-8
from django.core.management.base import BaseCommand
##
## FancyImageModel is a plugin model holding a ImageField called "oldimage" and
## FilerImageField "image". It removed duplicates based on the basename of the original
## image. This may or may not work for you.
from imageplugin.models import FancyImageModel