Hi,

Just wondering, how we could show initial value on the edit form. Let
say we have code like this to retrive the data ;

if request.method == 'GET':
    post = models.Post.get_by_key_name(key_name)
    editPostForm = postform.PostForm(initial={
                          'title': post.title,
                          'body': post.body,
                          'category': post.category,
                          'tags': ' '.join(post.tags)})

    return render_to_response('admin/newpost.html', {
                             'postForm':editPostForm,
                             'action':post.get_edit_url(),})

but when i code the form like this :
<input id="id_category" class="textInput" type="text" size="50"
name="category" max_length="30"
value="{% if postForm.category.data %}{{ postForm.category.data }}{%
endif %}">


it doesnt show up the initial category in the textfield. Please help,
thanks

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

Reply via email to