I've been putting together a player list for a sort of risk-like webgame-type thing me and a friend are working on, and I'm having trouble getting some text to display on a webpage.
Here's the code:

from django.http import HttpResponse

class players:
	def info(self, name, territory, color):
		self.name = name
		self.territory = territory
		self.color = color
		print "Player: ", self.name, "<br>Territor[y|ies]: ", self.territory, "<br>Color: ", self.color

NightKev = players()
CirvanteSHION = players()
CirvanteMeridian = players()
Darkdata = players()
Peardian = players()
Tyty210 = players()
Sukasa = players()
Tanks = players()
Madman200 = players()
FirePhoenix = players()

def playerlist(test):
	line1 = "Number of players: 10<br><br>"
	NK = NightKev.info("NightKev", "United States and Mexico", "Blue"), "<br>"
	CirvSHION = CirvanteSHION.info("Cirvante (SHION)", "Antarctica and Maelstrom", "Purple"), "<br>"
	CirvMerid = CirvanteMeridian.info("Cirvante (Meridian)", "5 scattered Airships", "White"), "<br>"
	Dd = Darkdata.info("Darkdata", "Greenland and Iceland", "Pink"), "<br>"
	Peard = Peardian.info("Peardian", "Europe", "Orange"), "<br>"
	Tyty = Tyty210.info("Tyty210", "Canada, Alaska, and Maine", "Red"), "<br>"
	Kasa = Sukasa.info("Sukasa", "China, New Zealand, and Japan", "Yellow"), "<br>"
	Tank = Tanks.info("Tanks", "Russia and Siberia", "Dark Green"), "<br>"
	MM200 = Madman200.info("Madman200", "South America", "Green"), "<br>"
	FP = FirePhoenix.info("FirePhoenix", "Africa", "Light Green")
	html = "<html><body> %s %s %s %s %s %s %s %s %s %s %s </body></html>" % (line1, NK, CirvSHION, CirvMerid, Dd, Peard, Tyty, Kasa, Tank, MM200, FP)
	return HttpResponse(html)

I've tried a whole bunch of variations on the code but I just can't seem to get it to display any of the info, all it shows is this: Image Link
Hopefully someone who is familiar with Django can help.

Of course ...
print will send the info to the console...
You should probabaly change line "8" to have a return !

class players:

  def info(self, name, territory, color):
    self.name = name
    self.territory = territory
    self.color = color
    return "Player: ", self.name, "<br>Territor[y|ies]: ", self.territory, " <br>Color: ", self.color

\T,

This article has been dead for over six months. Start a new discussion instead.