Opened 14 years ago

Last modified 13 years ago

#13376 new New feature

Messages should have an "expire" flag

Reported by: ryanshow@… Owned by:
Component: contrib.messages Version: 1.2-beta
Severity: Normal Keywords: messages, expire
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

Messages should have a flag which sets their expiration behavior. In the current messages framework, messages are automatically expired as soon as they are iterated over. This can be overridden if you explicitly set their "used" flag to false after they have been iterated. It would be nice to be able to set a flag which tells the message never to expire unless explicitly told to do so.

Attachments (4)

messages_expirity_capabilities.1.diff (36.9 KB ) - added by marekw2143 14 years ago.
messages_expirity_capabilities.2.diff (35.8 KB ) - added by marekw2143 13 years ago.
messages_expirity_capabilities.3.diff (37.3 KB ) - added by marekw2143 13 years ago.
messages_expirity_capabilities.4.diff (35.7 KB ) - added by marekw2143 13 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 by Russell Keith-Magee, 14 years ago

milestone: 1.3
Triage Stage: UnreviewedAccepted

Getting the right API will be important here, but I can see how the idea could be useful. Expiry based on time, number of displays, or some other request/user based flag could all be useful.

I've removed the 1.3 milestone because it's a feature request without a patch.

comment:2 by marekw2143, 14 years ago

Owner: changed from nobody to marekw2143
Status: newassigned

by marekw2143, 14 years ago

comment:3 by Bas Peschier, 13 years ago

Has patch: set

Pretty substantial patch, looks good at first sight, might take a deeper look soon.

comment:4 by Bas Peschier, 13 years ago

Needs documentation: set
Patch needs improvement: set

After inspection I have a couple of notes on the (otherwise good) patch:

  • I do not completely agree with the chosen api-functions on restrictions; on_iter and to_remove are too vague, I would use something along the lines of on_display since iteration could be happening at a lot of different points of time and is_expired to put more emphasis on the conceptual state (restriction expired) instead of the procedural state (we have to remove it).
  • The changes in the API must be documented so people can actually make use of restrictions without having to read code.
  • There are quite a few spelling errors and typos in the patch which give it a rushed feeling

comment:5 by Bas Peschier, 13 years ago

After going through the "storage" discussion on the mailing list, I looked a bit further into the patch and spotted something related which should be improved: at the moment the encoding is done centrally in storage/cookie.py with hardcoded checks for types. Maintaining different types of restrictions becomes a real pain in the backside this way. It should be de-centralised to the actual restriction class (which brings the problem of determining which restriction should be loaded for the decode).

by marekw2143, 13 years ago

by marekw2143, 13 years ago

comment:6 by Gabriel Hurley, 13 years ago

Component: Contrib appscontrib.messages

comment:7 by Julien Phalip, 13 years ago

Severity: Normal
Type: New feature

by marekw2143, 13 years ago

comment:8 by marekw2143, 13 years ago

Easy pickings: unset
Owner: marekw2143 removed
Status: assignednew
UI/UX: unset
Note: See TracTickets for help on using tickets.
Back to Top