The HTML in the template is fairly easy to do:

{% if object %}
we have an object so we're updating
{% else %}
no object so we're inserting
{% endif %}

I'm not quite sure how you want to handle the viewing part though.

In the form HTML, just create your form as if you are doing an update:
{% if form.title.errors %}
<p class="error">{{ form.name.errors|join:", "}}</p>
{% endif %}
<label for="id_title" class="required">Event Description:</label>
{{ form.title }}<br />
<p class="help">Enter the name of the event.</p>

* if the form title in my example contains no data, it will show up
empty. If it has data, it will be filled.

Pretty easy. The tougher part is in the views.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to