hi
I created a view function to edit an entry.
def edit_entry(request,id):
        entry=get_object_or_404(MyEntry,id=id)
        if request.method=='POST':
                form=MyEntryForm(request.POST,instance=entry)
                if form.is_valid():
                        form.save()
                        redirect('myapp_entry_archive_index')
        else:
                form=MyEntryForm(instance=entry) #for GET method and invalid 
forms

        return render_to_response('myapp/myentry_edit_entry.html',
{'entryform':form})

then I created the urls like
url(r'^editentry/(?P<id>\d+)/
$','myapp.views.edit_entry',name='myapp_edit_entry'),

My problem here is how I should give the action in form in the
template.
I tried
<form action="/myapp/editentry/" method="post">
{{entryform.as_ul }}
<input type="submit" value="Submit">
</form>

But since the /myapp/editentry/ doesn't match any urls ,it gives a
404. How should I pass the id  of entry(which is to be edited) to
action?

I know this is a silly doubt..But I am a newbie to web programming..If
anyone can help please do

jim

-- 
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