Skip to content

Loading…

Madam, I've added event badge generator code #3

Merged
merged 1 commit into from

2 participants

@yeskarthik

Please accept. PLEASE... i ll get you another Dairy Milk Silk :D

@madhuvishy madhuvishy merged commit 45ed4bc into madhuvishy:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 11, 2011
  1. Badge Generator service added

    Karthik Subramanian committed
1 badge/BadgeGen
@@ -0,0 +1 @@
+Subproject commit e08bb87c48bc3f322dd0887fc04a58192ac94c70
View
BIN badge/__init__.pyc
Binary file not shown.
View
BIN badge/forms.pyc
Binary file not shown.
View
BIN badge/models.pyc
Binary file not shown.
View
BIN badge/urls.pyc
Binary file not shown.
View
13 badge/views.py
@@ -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.
@@ -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:
View
BIN badge/views.pyc
Binary file not shown.
Something went wrong with that request. Please try again.