Opened 18 years ago

Closed 17 years ago

#4572 closed (fixed)

How to use form_for_instance could benefit from more explanation

Reported by: toddobryan@… Owned by: Jacob
Component: Documentation Version: dev
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I've attached a patch.

Attachments (3)

form_for_instance_patch.txt (1.3 KB ) - added by toddobryan@… 18 years ago.
patch including an extra paragraph of explanation for form_for_instance
form_for_instance_patch.2.txt (1.7 KB ) - added by toddobryan@… 17 years ago.
patch to clarify how to use form_for_instance
form_for_instance.patch (1.4 KB ) - added by anonymous 17 years ago.

Download all attachments as: .zip

Change History (10)

by toddobryan@…, 18 years ago

Attachment: form_for_instance_patch.txt added

patch including an extra paragraph of explanation for form_for_instance

comment:1 by Chris Beaven, 17 years ago

Patch needs improvement: set
Triage Stage: UnreviewedAccepted

Your description doesn't match the code, you actually create a new form class using form_for_instance and instantiate this in GET and POST.

comment:2 by toddobryan@…, 17 years ago

You are absolutely correct. I'll fix this as soon as I can. Unfortunately, I'm at a hotel with not very reliable wireless service and can't access the SVN repository, so it will probably be Monday afternoon before I can get to it.

by toddobryan@…, 17 years ago

patch to clarify how to use form_for_instance

comment:3 by toddobryan@…, 17 years ago

OK. The docs have been updated to match the code.

comment:4 by Chris Beaven, 17 years ago

if request.method == 'POST': is actually the proper way to check for a POST call, the ticket is a bit messy adding in some ignores, and get_object_or_404 isn't a function of the Manager - it's a shortcut.

Maybe you could submit as a .diff or .patch too, that might fix trac not displaying the patch correctly.

Thanks :)

by anonymous, 17 years ago

Attachment: form_for_instance.patch added

comment:5 by toddobryan@…, 17 years ago

OK...

  • request.method == 'POST'...check
  • get_object_or_404() function fixed (big whoops on that)...check
  • submitted as .patch, which does fix the display...check

I don't understand what you mean by "the ticket is a bit messy adding in some ignores," but will be happy to de-messify if you can clarify.

I don't know why you're being so picky about all these issues. If everything is perfect before it gets checked in, there won't be anything for anyone else to fix later. :-) Seriously, though, thanks for looking.

comment:6 by Chris Beaven, 17 years ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

Don't worry, Adrian will still find lots to fix with it. I just go after the glaring mistakes ;)

comment:7 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

(In [5988]) Fixed #4572 -- Added an example of form_for_instance usage in a full-fledged view. Based on a patch from toddobryan@….

Note: See TracTickets for help on using tickets.
Back to Top