Re: Trying to Edit Existing Post; Can't Get Form to Display

2012-05-21 Thread DF
Thanks for that insight. It's always good to reinforce best practices for newcomers like myself. On Monday, May 21, 2012 7:47:33 AM UTC-4, bruno desthuilliers wrote: > > On May 19, 5:41 pm, Jonathan Baker > wrote: > > Just a note about best practises: > > > > > # views.py > > (snip) > > >

Re: Trying to Edit Existing Post; Can't Get Form to Display

2012-05-21 Thread bruno desthuilliers
On May 19, 5:41 pm, Jonathan Baker wrote: Just a note about best practises: > > # views.py (snip) >             return HttpResponseRedirect("/report/all/") Better to use named urls and django.core.urlresolvers.reverse, this avoids quite a lot of pain and trouble when you have to change your u

Re: Trying to Edit Existing Post; Can't Get Form to Display

2012-05-19 Thread DF
Perfect! That worked! Thank you so much! I was stumped. Your revisions were much simpler and easy to understand as well. I really appreciate when I can learn something, especially a more straightforward process that is less complex and achieves the same desired results. Thank you, again! On S

Re: Trying to Edit Existing Post; Can't Get Form to Display

2012-05-18 Thread DF
Thanks. I get this error using that code: TypeError at /report/detail/30/edit/ __init__() takes at least 2 arguments (1 given) This is referring to this line: story_form = StoryForm(instance=story) I added a "story_id" argument to this, which brought up the form, but when I submitted it

Re: Trying to Edit Existing Post; Can't Get Form to Display

2012-05-18 Thread DF
Thanks. This worked: else: story_form = StoryForm(request.user, instance=story_form) One problem: it just adds a new version of the story instead of updating the previous version. So "editing" just creates multiple versions instead of actually editing the existing story. Is there a wa

Re: Trying to Edit Existing Post; Can't Get Form to Display

2012-05-18 Thread Jonathan Baker
The lines: #else: #story_form = StoryForm(instance=story_form) ...appear to be handling the GET request, and they're commented out. On Fri, May 18, 2012 at 3:22 PM, DF wrote: > Newbie question. I have an application where registered users can submit > stories. The posting and display