Code

Opened 3 months ago

Closed 2 months ago

Last modified 2 months ago

#21935 closed New feature (wontfix)

Add the object to data used for the message

Reported by: david.fischer.ch@… Owned by: nobody
Component: contrib.messages Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It would be interesting to add the object into the cleaned_data dictionary to allow displaying a success message with some values taken from the object's attributes.

Attachments (1)

0001-Add-theobjecttodatausedforthemessage.patch (770 bytes) - added by david.fischer.ch@… 3 months ago.
The patch for this contribution

Download all attachments as: .zip

Change History (3)

Changed 3 months ago by david.fischer.ch@…

The patch for this contribution

comment:1 Changed 2 months ago by timo

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

From the docs: "For ModelForms, if you need access to fields from the saved object override the get_success_message() method."

I think it's a better solution than putting in lots of hasattr checks for everyone's specific uses.

comment:2 Changed 2 months ago by anonymous

Ok thanks for the tip.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.