This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from linklooker.linklooker import Links, Link | |
import argparse | |
import csv | |
def output_results(results, output_file): | |
if not results: | |
exit("Couldn't find any results!") | |
# Write out header |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from linklooker.linklooker import Links, Link | |
import argparse | |
import csv | |
def output_results(results, output_file): | |
if not results: | |
exit("Couldn't find any results!") | |
# Write out header |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.http import HttpResponse, HttpResponseBadRequest | |
from django.shortcuts import render_to_response, get_object_or_404 | |
from django.views.decorators.csrf import csrf_exempt | |
from django.forms.models import inlineformset_factory | |
from django.db.models import Min | |
from django.utils import simplejson | |
from annoying.decorators import render_to | |
from paypal import interface | |
from models import Category, Organiser, Event, Buyer, Guest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@render_to('book.html') | |
def book(request): | |
if request.POST: | |
event = Event.objects.get(pk=request.POST['event_id']) | |
#ticket_rows = [] | |
guest_formsets = [] | |
for ticket in event.ticket_set.all(): | |
qty = int( request.POST['qty-%s' % ticket.id] ) | |
formset = inlineformset_factory( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="book"> | |
<h2 class="title">{{ organiser_name }} {{ event_name }}</h2> | |
<form id="booking-form" method="post" action=""> | |
{% for ticket_row in ticket_rows %} | |
<h3>{{ ticket_row.ticket }} {{ forloop.revcounter }}</h3> | |
{% for formset in ticket_row.formset %} | |
{{ formset.errors }} | |
{% for field in formset %} | |
{{ forloop.counter }} | |
{{ field }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from linklooker.linklooker import Links, Link | |
import argparse | |
import csv | |
def output_results(results, output_file): | |
if not results: | |
exit("Couldn't find any results!") | |
#TODO: use for -v mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 9095 default; | |
client_max_body_size 4G; | |
server_name 109.88.33.22; | |
keepalive_timeout 50; | |
# path for static files | |
root /home/edward/Projects/MyProject/public; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_images(self): | |
""" | |
Convenience method, gets all images except primary image | |
Returns empty string if none can be found | |
""" | |
print "DBG2: In get_images" | |
image_collection = self.eventimage_set().filter(primary=False) | |
print "DBG3: %s" % image_collection | |
if image_collection: | |
return image_collection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EventImage(models.Model): | |
event = models.ForeignKey(Event) | |
image = models.ImageField(upload_to=self.event.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($_POST) { | |
header("HTTP/1.0 200 OK"); | |
global $mosConfig_absolute_path, $mosConfig_live_site, $mosConfig_lang, $database, | |
$mosConfig_mailfrom, $mosConfig_fromname; | |
/*** access Joomla's configuration file ***/ | |
$my_path = dirname(__FILE__); |