Beispiel #1
0
def add(request):
	loged = user.isLogin(request)
	if loged:
		t = get_template("add.html")
	else:
	 	t = get_template("login.html")
	c = Context({
				"loged": loged,
			})
	return HttpResponse(t.render(c))
Beispiel #2
0
def articleModify(request, articleId):

	loged = user.isLogin(request)
	if loged:
		t = get_template("add.html")
	else:
	 	t = get_template("login.html")

	article = Articles.objects.get(id=articleId)
	c = Context({
			"title": article.title,
			"content": article.content,
			"author": article.author,
			"articleId": articleId,
			"loged": loged,
			})
	return HttpResponse(t.render(c))
Beispiel #3
0
def article(request, articleId):
	t = get_template("article.html")
	loged = user.isLogin(request)
	article = Articles.objects.get(id=articleId)
	article.scanTimes += 1
	article.save()
	global mon
	year, month, day, hour, minu, sec = article.tsp.split(":")
	tsp = mon[int(month) - 1] + " " + day + "/" + year
	return HttpResponse(t.render(Context({
					"articleId": article.id,
					"articleTitle": article.title,
					"content": article.content,
					"author": article.author,
					"scanTimes": article.scanTimes,
					"weight": article.weight,
					"tsp": tsp,
					"desc": article.desc,
					"tag": article.tag,
					"loged": loged,
					})))