Django

Code

Ticket #11617 (closed: duplicate)

Opened 8 months ago

Last modified 8 months ago

Enhance User Message System

Reported by: ckarrie Assigned to: nobody
Milestone: 1.2 Component: Authentication
Version: 1.0 Keywords: user message enhancement
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Hi,

I would like to see a enhanced user message system that allows to specify some base types of the message.

For example:

  • message_type = 'Error'
  • message_type = 'Success'
  • message_type = 'Notice'

That would be very practicable if you do an custom action and want to display as a user message, if it has failed or not.

An example for validating a Model using a Admin Action for further calculations could look like this:

# admin.py (fictional code)

def validate(modeladmin, request, queryset):
    for q in queryset.all():
        message = u"%s: %s" %(q.name, q.validate())
        if q.is_valid:
            message_type = 'Success'
        else:
            message_type = 'Error'
        request.user.message_set.create(message=message, message_type=message_type)
validate.short_description = "Validate for Agl"

Attachments

Change History

08/01/09 07:18:39 changed by ramiro

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

I'm tempted to close this as a d uplicate of #4606 where the addition of a type to the message is one of the proposed/asked for features of a new messaging system.

08/01/09 07:35:33 changed by ramiro

oops, I meant #4604

08/01/09 08:13:38 changed by kmtracey

  • status changed from new to closed.
  • resolution set to duplicate.

It's a more direct duplicate of #3995.

08/01/09 08:17:18 changed by ckarrie

You're right, is a duplicate of 4604 and 3995, I'm sorry


Add/Change #11617 (Enhance User Message System)




Change Properties
Action