Ejemplo n.º 1
0
def post_create(request):
	form = CollectionForm(request.POST or None)
	collectionList = []
	for field in Collection._meta.fields:
		temp = field.get_attname_column()[0]
		collectionList.append(temp)

	string = genericFormLoader(collectionList)
	context = { "form": form, "string": string }

	if form.is_valid():
		instance = form.save(commit=False)
		instance.save()
		return HttpResponseRedirect('/collection/create')
	else:
		form = CollectionForm()

		return render(request, "create.html", context)
Ejemplo n.º 2
0
def post_create(request):
    form = Log_Entry(request.POST or None)
    #ADD FROM HERE
    logList = []
    for field in Log_Entry._meta.fields:
        temp = field.get_attname_column()[0]
        logList.append(temp)

    string = genericFormLoader(logList)
    context = {"form": form, "string": string}
    #ADD TO HERE

    if form.is_valid():
        instance = form.save(commit=False)
        instance.save()
        return HttpResponseRedirect('/logentry/create')
    else:
        form = SizeForm()

    return render(request, "create.html", context)
Ejemplo n.º 3
0
def post_create(request):
    form = PatternPieceForm(request.POST or None)
    #ADD FROM HERE
    patternPieceList = []
    for field in Pattern_Piece._meta.fields:
        temp = field.get_attname_column()[0]
        patternPieceList.append(temp)

    string = genericFormLoader(patternPieceList)
    context = {"form": form, "string": string}
    #ADD TO HERE

    if form.is_valid():
        instance = form.save(commit=False)
        instance.save()
        return HttpResponseRedirect('/patternpiece/create')
    else:
        form = PatternPieceForm()

    return render(request, "create.html", context)