Skip to content

Commit

Permalink
Badge Generator service added
Browse files Browse the repository at this point in the history
  • Loading branch information
yeskarthik committed Dec 11, 2011
1 parent af61c6f commit 45ed4bc
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions badge/BadgeGen
Submodule BadgeGen added at e08bb8
Binary file removed badge/__init__.pyc
Binary file not shown.
Binary file modified badge/forms.pyc
Binary file not shown.
Binary file modified badge/models.pyc
Binary file not shown.
Binary file removed badge/urls.pyc
Binary file not shown.
13 changes: 13 additions & 0 deletions badge/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.shortcuts import render_to_response
from BadgeGen import createBadges
#from django.contrib.auth import authenticate,login
from forms import BadgeForm
# Create your views here.
Expand All @@ -12,9 +13,21 @@ def errorHandle(error):
form = BadgeForm()
return render_to_response('badge/input.html', {'error':error, 'form':form,})

def handle_uploaded_file(f):
#destination = open('./BadgeGen/sample.csv', 'wb+')
#for chunk in f.chunks():
# destination.write(chunk)
#destination.close()
ob = createBadges.BadgeMaker(f,template = "BadgeGen/badge_template_white.png",namecol = "black", fontname = "BadgeGen/arial.ttf" )

ob.generateBadges()


if request.method == 'POST':
form = BadgeForm(request.POST, request.FILES)
fname = request.POST['fname']
handle_uploaded_file(request.FILES['csvfile'])

#if form.is_valid():
return render_to_response('badge/success.html', {'fname':fname})
#else:
Expand Down
Binary file removed badge/views.pyc
Binary file not shown.

0 comments on commit 45ed4bc

Please sign in to comment.