On 1/15/07, Ramdas S <[EMAIL PROTECTED]> wrote:
How do I get the templates to render the following form from the views.py given below as as unordered list, instead of the standard table formt. This is a simple four fields ContactForms, created out of the table Contacts.
form.as_ul() Theres also `form.as_p()` and the default `form.as_table()`. You can either use that to pass your form to your context, or you can call it directly in the template.
Currently it is emmiting the HTML as as a a table class. def index(request): ContactForm = forms.models.form_for_model(Contacts) if request.method == 'POST': form = ContactForm( request.POST) if form.is_valid(): form.save() return HttpResponse('Message Recd') else: form = ContactForm() t = loader.get_template('contactus.html ') c = Context({'form': form, }) return HttpResponse(t.render(c)) I can make the template behave the way I want to using CSS. But that is not the idea... >
-- ---- Waylan Limberg [EMAIL PROTECTED] --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---