Thursday, October 13, 2011

Please help to get templates working at all

I am writing my personal contact book and now want to make wish list
for Christmas. I cannot get simplest template working, the template
is:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Kampanie</title>
</head>
<body>

{% for campaign in campaigns %}
{{ campaign.name }}
{% endfor %}

</body>
</html>

The model is :

class Campaign(models.Model):
name = models.CharField(u"Nazwa", max_length=255, null=False,
blank=False)
objects = CampaignManager()
def __unicode__(self):
return "%s" % unicode(self.name)

and the view is:

def campaigns(request):
form = CampaignForm(request.GET)
ctx = {'form': form, "action": "view"}
return render_to_response("campaigns.html", ctx,
context_instance=RequestContext(request))

The code is greatly copy and paste from working parts. I'd be very
grateful for help, I amd dying of bore and am keen to code, but
unfortunately my Python friend that usually helped me is too busy
nowadays.

And Merry Christmas to all :-)

Regards,

Piotr Hosowicz

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment