Opened 8 years ago

Closed 6 years ago

#8167 closed (fixed)

Allow custom message to be set in the create/update/delete generic views

Reported by: peterd12 Owned by: ColtonProvias
Component: Generic views Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


The views in django.views.generic.create_update automatically creates the message "The %(verbose_name)s was deleted." It would be nice to have an additional argument to these views called "message" where users could set their own message. For instance, I'm using the message '%(verbose_name)s "%(object_name)s" successfully deleted' in my views.

Attachments (1)

create_message.diff (4.0 KB) - added by ColtonProvias 8 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 8 years ago by adamfast

  • milestone set to post-1.0
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

Changed 8 years ago by ColtonProvias

comment:2 Changed 8 years ago by ColtonProvias

  • Has patch set

I attempted to create a small patch to add on this functionality. It processes the string passed to it as a template and renames model._meta to model.meta. If something doesn't work, I apologize as this is my first attempt at a patch to django.

comment:3 Changed 8 years ago by ColtonProvias

  • Owner changed from nobody to ColtonProvias
  • Status changed from new to assigned
  • Triage Stage changed from Design decision needed to Accepted

comment:4 Changed 8 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:5 Changed 6 years ago by russellm

  • Resolution set to fixed
  • Status changed from assigned to closed

The introduction of class-based views in [14254] will allow you to do this.

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