示例#1
0
def get_conference_committees(request, conference):
    existing_committees = serializers.serialize(
        "json", Committee.objects.filter(conference=conference), fields=("name")
    )
    form = NewCommitteeForm()

    return simplejson.dumps(
        {"form": '<table class="form">' + form.as_table() + "</table>", "objects": existing_committees}
    )
示例#2
0
def add_committee(request, conference):
    if request.method == 'POST':
        form = NewCommitteeForm(data=request.POST)
        if(form.is_valid(conference)):
            committee = form.save(commit=False)
            committee.conference = conference
            committee.url_name = slugify(committee.name)
            committee.save()
            return simplejson.dumps({'pk':committee.pk, 'name':committee.name})
        else:
            return simplejson.dumps({'form':"<table class=\"form\">" + form.as_table() + "</table>"})
示例#3
0
def add_committee(request, conference):
    if request.method == "POST":
        form = NewCommitteeForm(data=request.POST)
        if form.is_valid(conference):
            committee = form.save(commit=False)
            committee.conference = conference
            committee.url_name = slugify(committee.name)
            committee.save()
            return simplejson.dumps({"pk": committee.pk, "name": committee.name})
        else:
            return simplejson.dumps({"form": '<table class="form">' + form.as_table() + "</table>"})
示例#4
0
def add_committee(request, conference):
    if request.method == 'POST':
        form = NewCommitteeForm(data=request.POST)
        if(form.is_valid(conference)):
            committee = form.save(commit=False)
            committee.conference = conference
            committee.url_name = slugify(committee.name)
            committee.save()
            return simplejson.dumps({'pk':committee.pk, 'name':committee.name})
        else:
            return simplejson.dumps({'form':"<table class=\"form\">" + form.as_table() + "</table>"})
示例#5
0
def get_conference_committees(request, conference):
    existing_committees = serializers.serialize(
        'json',
        Committee.objects.filter(conference=conference),
        fields=('name'))
    form = NewCommitteeForm()

    return simplejson.dumps({
        'form':
        "<table class=\"form\">" + form.as_table() + "</table>",
        'objects':
        existing_committees
    })
示例#6
0
def get_conference_committees(request, conference):
    existing_committees = serializers.serialize('json', Committee.objects.filter(conference=conference), fields=('name'))
    form = NewCommitteeForm()
    
    return simplejson.dumps({'form':"<table class=\"form\">" + form.as_table() + "</table>", 'objects':existing_committees})