Example #1
0
from decorators import staff_required

from notes.logic import get_notes
from actions.actions import RequestPosition, SuggestPosition
from offers.models import Offer
from profiles.models import BaseProfile, VolunteerProfile

from models import *
from forms import *


from lib.ximage import ImageProcessor, ImageCache
import lib.ximage.operations as ops

cache = ImageCache(MEDIA_ROOT + "/cache/")
process = [ops.square(), ops.resize(300, 300)]
processor = ImageProcessor(cache, process)

class LatestPositionsFeed(Feed):
    title = "Latest Volunteering Opportunities"
    link = "/"
    description = "Latest Volunteering Opportunities"

    def items(self):
        return Position.objects.order_by('-date_created')[:10]

    def item_title(self, item):
        return "%s - %s" % (item.organisation.name, item.name)

    def item_description(self, item):
        return item.summary
Example #2
0
from models import *
from positions.models import Organisation, Position
from notes.logic import get_notes
from forms import *

from hours.models import Endorsement

from actions.actions import Action

import logic
import settings


# Volunteer photos
cache = ImageCache(settings.MEDIA_ROOT + "/cache/")
process = [ops.square(), ops.resize(200, 200)]
processor = ImageProcessor(cache, process)

thumb_process = [ops.square(), ops.resize(150, 150)]
thumb_processor = ImageProcessor(cache, thumb_process)


def all_of(choices):
    return [unicode(c[0]) for c in choices]

def booleanise(choices):
    return [c == u'True' for c in choices]


class DummyForm(object):
    """Pretends to be a form. Allows multiple forms to be handled
Example #3
0
File: views.py Project: somair/xvs
from models import *
from positions.models import Organisation, Position
from notes.logic import get_notes
from forms import *

from hours.models import Endorsement

from actions.actions import Action

import logic
import settings

# Volunteer photos
cache = ImageCache(settings.MEDIA_ROOT + "/cache/")
process = [ops.square(), ops.resize(200, 200)]
processor = ImageProcessor(cache, process)

thumb_process = [ops.square(), ops.resize(150, 150)]
thumb_processor = ImageProcessor(cache, thumb_process)


def all_of(choices):
    return [unicode(c[0]) for c in choices]


def booleanise(choices):
    return [c == u'True' for c in choices]


class DummyForm(object):
Example #4
0
File: views.py Project: somair/xvs
from decorators import staff_required

from notes.logic import get_notes
from actions.actions import RequestPosition, SuggestPosition
from offers.models import Offer
from profiles.models import BaseProfile, VolunteerProfile

from models import *
from forms import *

from lib.ximage import ImageProcessor, ImageCache
import lib.ximage.operations as ops

cache = ImageCache(MEDIA_ROOT + "/cache/")
process = [ops.square(), ops.resize(300, 300)]
processor = ImageProcessor(cache, process)


class LatestPositionsFeed(Feed):
    title = "Latest Volunteering Opportunities"
    link = "/"
    description = "Latest Volunteering Opportunities"

    def items(self):
        return Position.objects.order_by('-date_created')[:10]

    def item_title(self, item):
        return "%s - %s" % (item.organisation.name, item.name)

    def item_description(self, item):