projects changes

This commit is contained in:
Karen 2011-10-05 17:32:49 +05:30
commit 77eb530663
3 changed files with 5 additions and 4 deletions

View File

@ -146,5 +146,3 @@
-->
</ul>
{% endblock %}

View File

@ -1,5 +1,6 @@
from django.db import models
from os.path import join
from sorl.thumbnail import get_thumbnail
def project_thumb_path(instance, filename):
return join('project_thumbs', instance.slug, filename)
@ -32,8 +33,9 @@ class Project(models.Model):
def get_images(self):
imgs = []
for i in self.projectimage_set.all():
image_url = get_thumbnail(i.image, "x450", crop="center").url
imgs.append({
'url': i.image.url,
'url': image_url,
'caption': i.caption
})
return imgs

View File

@ -4,6 +4,7 @@ from models import *
import json
from ox.django.shortcuts import render_to_json_response
def home(request):
return render_to_response("home.html", {})