Django

Code

Ticket #4604 (closed: fixed)

Opened 3 years ago

Last modified 2 months ago

session-based messages

Reported by: Sean Patrick Hogan <sp.hogan@gmail.com> Assigned to: tobias
Milestone: 1.2 Component: Contrib apps
Version: SVN Keywords:
Cc: goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, pedro.lima@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, hwaara@gmail.com, siddhartag@hotmail.com, tonn81@gmail.com, julian@xairro.com, flosch@gmail.com, daniel.tritone@gmail.com, walter.php@gmail.com, mikecampo@gmail.com Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 1

Description

Right now, in order to pass a message to the next view, you can use "User.message_set.create('Your whatever has been saved successfully!')"

That works for logged-in users, but doesn't help users who aren't logged in and it's probably more complicated than it needs to be.

By contrast, we could store messages in the user's session. Every user (logged in or not) has a session that uniquely identifies them. By creating a request processor and middleware, we can make this process work for all users.

With the attached patch, you can put the FlashMiddleware? into the middleware tuple and the Flash context processor into the tuple for context processors and then simply do: "request.flash = 'Your whatever has been saved successfully!'

Since it runs off of the session data rather than the user data, it works without someone having to have logged in. This is very useful in many contexts. Also, I don't think we gain anything by storing it in the DB with a FK to User. Having it in the session just makes it nicely encapsulated to the browsing person.

**Flash is what Rails calls this functionality, but if someone wants to rename it to 'message', that's fine by me. request.message = 'Apple' might be easier for people to understand.

Attachments

__init__.py (327 bytes) - added by Sean Patrick Hogan <sp.hogan@gmail.com> on 06/17/07 14:56:28.
FlashMiddleware? and flash context processor
visitor_messages.patch (4.9 kB) - added by SmileyChris on 06/18/07 18:40:22.
visitor_messages_upd_6373.patch (6.6 kB) - added by Pedro Lima <pedro.lima@gmail.com> on 09/18/07 14:28:59.
Update to visitor_messages patch to use session backends
visitor_messages_r6373.patch (6.6 kB) - added by Pedro Lima <pedro.lima@gmail.com> on 09/19/07 04:29:20.
Updated patch to new session implementation and included the suggested documentation change
visitor_messages_r6596.upatch (5.9 kB) - added by msaelices on 10/23/07 07:51:12.
Updated patch for revision 6596
visitor_messages_r6596.patch (6.3 kB) - added by msaelices on 10/23/07 09:44:20.
Updated patch for revision 6596
messages.diff (11.9 kB) - added by SmileyChris on 12/09/07 20:57:47.
Rewritten version, new core context processor which grabs messages from both user and session
messages.2.diff (15.3 kB) - added by SmileyChris on 12/13/07 21:41:57.
More tests
messages.3.diff (15.1 kB) - added by SmileyChris on 12/13/07 21:47:34.
removed unnecessary imports
messages.4.diff (15.1 kB) - added by __hawkeye__ on 12/14/07 08:11:07.
Slight documentation change.
messages.5.diff (15.2 kB) - added by SmileyChris on 01/19/08 19:06:28.
Now with better backwards compatibility
messages.5.2.diff (15.2 kB) - added by SmileyChris on 01/22/08 16:20:15.
identical to previous, except has empty init.py and models.py files for tests
messages.6.diff (15.4 kB) - added by SmileyChris on 01/22/08 16:20:41.
identical to previous, except has empty init.py and models.py files for tests (no, really this time)
messages.7.diff (15.5 kB) - added by SmileyChris on 01/31/08 20:47:31.
implement __getitem__ too, some people are using stuff like {{ messages.0 }}
messages-r8347.diff (12.7 kB) - added by john on 08/14/08 11:21:26.
Updated messages.7.diff to avoid rejects with django.core.context_processors.py
t4604-r9698.diff (14.7 kB) - added by ramiro on 01/05/09 07:28:12.
Patch updated to r9698.
django-contrib-messages-9f54c0f8719c.diff (81.8 kB) - added by tobias on 11/17/09 07:25:35.
diff showing changes in django-contrib-messages branch as of changeset 9f54c0f8719c
django-contrib-messages-e4da706e1152.diff (96.5 kB) - added by tobias on 12/03/09 00:36:07.
diff showing changes in django-contrib-messages branch as of changeset e4da706e1152
django-contrib-messages-6399c12d1773.diff (98.0 kB) - added by tobias on 12/05/09 13:31:36.
changes in django-contrib-messages branch as of rev 6399c12d1773
django-contrib-messages.2.diff (98.5 kB) - added by tobias on 12/09/09 07:09:01.
django-contrib-messages.diff (98.5 kB) - added by tobias on 12/09/09 07:09:52.
final patch from django-contrib-messages branch

Change History

06/17/07 14:56:28 changed by Sean Patrick Hogan <sp.hogan@gmail.com>

  • attachment __init__.py added.

FlashMiddleware? and flash context processor

06/18/07 02:48:01 changed by SmileyChris

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

I definitely don't like the name, but the idea is interesting. It does seem like messages naturally fit the session (maybe moreso than the users)

This has to go to a design decision, I recommend you bring this up on the dev group.

06/18/07 02:48:23 changed by SmileyChris

  • needs_better_patch set to 1.
  • component changed from Uncategorized to Contrib apps.
  • needs_tests set to 1.
  • owner changed from jacob to adrian.
  • needs_docs set to 1.
  • stage changed from Unreviewed to Design decision needed.

06/18/07 09:11:51 changed by ubernostrum

I'm pretty sure this is a duplicate of a request that was filed a while back for the same thing (messages tied to sessions so they'd work with non-authenticated users), but I can't find it and I don't think the other one had a patch.

06/18/07 18:40:22 changed by SmileyChris

  • attachment visitor_messages.patch added.

06/18/07 18:41:16 changed by SmileyChris

  • needs_better_patch deleted.
  • needs_tests deleted.
  • needs_docs deleted.

Here's my take on it, with tests and docs.

06/24/07 05:18:18 changed by anonymous

I would really replace the current Message-system with this one. Besides from beeing more generic it fixes a race-condition, that could happen when two users surf with the same account and both receive messages. Should be rare, but is fixed with this patch.

06/24/07 12:31:02 changed by anonymous

Two users shouldn't be using the same account though :)

06/25/07 14:17:53 changed by anonymous

  • cc set to goliath.mailinglist@gmx.de.

06/26/07 19:57:18 changed by mrmachine

  • cc changed from goliath.mailinglist@gmx.de to goliath.mailinglist@gmx.de, real.human@mrmachine.net.

Two people may often share an account. For many applications there is no need to create a unique user for every person who will use the system, one superuser and one manager is often sufficient for many small projects.

I'd love to see messages attached to sessions instead of users, although it doesn't necesarily need to *replace* the user messages functionality which could also be useful (setting messages offline to be received at next login).

I also thought this issue had another ticket (with a patch) already.

06/29/07 13:30:39 changed by Ben Slavin <benjamin.slavin@gmail.com>

Nice patch, Chris. Two things I wanted to bring up though...

  1. Looks like your patch is impacted by #4729. As a result, if the message is set and the session is persisted, the message will never be deleted by get_and_delete_messages.
  1. I wonder if the use of a LazyMessage style object might be helpful. This would ensure that the messages aren't actually purged until they are viewed.

06/29/07 16:22:07 changed by SmileyChris

Thx Ben. Yep, looks like it does rely on #4729 - that's a bit less straightforward than it actually looks however (see my comment there).

Regarding a LazyMessage, perhaps, but that's a full change of functionality. Things like that help leave tickets in DDR for much longer. Hmm, it does actually sound quite useful. Damn... :)

06/29/07 16:48:00 changed by Ben Slavin <benjamin.slavin@gmail.com>

My apologies for the LazyMessage suggestion ;-)

I quickly threw together a context processor that uses lazy evaluation for both (or either) Session and User messages... I ended-up breaking it out of contrib (into my own project) though since it doesn't fit nicely in either contrib.sessions or contrib.auth.

If there's interest I can break it apart to handle only session messages (visitor_messages as you've named them) and post it here... but I don't have the time to write the necessary tests right now.

07/05/07 05:53:32 changed by SmileyChris

I sat down and had a good think about the LazyMessage idea and I'm not sure that it is actually necessary. You don't have to use the context processor, you could use the django.core.context_processors.request context processor and access the messages directly:

{% for message in request.session.get_and_delete_messages %}...{% endfor %}

So we're (thankfully) back to the only design decision left being whether the original idea itself is actually core-worthy...

07/08/07 16:09:18 changed by John Shaffer <jshaffer2112@gmail.com>

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com.

07/09/07 04:36:53 changed by Thomas Güttler <hv@tbz-pariv.de>

The visitor_messages.patch works for me.

One thing: ""The session message system provides a simple way to queue messages for

anonymous site visitors. To associate messages with users in the user database,

use the authentication message framework_."""

I would say: ""The session message system provides a simple way to queue messages for

all (anonymous or authenticated) site visitors. If you want to associate messages

with users in the user database ..."""

07/11/07 19:16:09 changed by miracle2k <michael@elsdoerfer.info>

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com.

09/18/07 14:28:59 changed by Pedro Lima <pedro.lima@gmail.com>

  • attachment visitor_messages_upd_6373.patch added.

Update to visitor_messages patch to use session backends

09/18/07 14:31:28 changed by Pedro Lima <pedro.lima@gmail.com>

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com.

09/19/07 04:29:20 changed by Pedro Lima <pedro.lima@gmail.com>

  • attachment visitor_messages_r6373.patch added.

Updated patch to new session implementation and included the suggested documentation change

10/04/07 03:17:52 changed by Thomas Güttler <hv@tbz-pariv.de>

  • needs_better_patch set to 1.

There is a bug in visitor_messages_r6373.patch

old:

    def get_and_delete_messages(self):  
        return self.pop(self.MESSAGES_NAME, [])

new:

    def get_and_delete_messages(self):
        msgs = self.pop(self.MESSAGES_NAME, [])
        if msgs:
            self.modified = True  
        return msgs

10/04/07 03:23:27 changed by Thomas Güttler <hv@tbz-pariv.de>

I think it would be nice to have a loglevel.

KNOWN_LOGLEVELS=["info", "error"]

class Message(object):
    def __init__(self, message, loglevel="info"):
        self.message=message
        assert loglevel in KNOWN_LOGLEVEL
        self.loglevel=loglevel
    def __unicode__(self):
        return self.message

def create_message(self, message, loglevel="info"):
    ...
    messages.append(Message(message, loglevel))
    ...

10/04/07 08:57:34 changed by __hawkeye__

  • needs_better_patch deleted.

Hello Thomas,

The change you mention (self.modified = True) is not a problem with this patch... this patch just reveals the problem.

The recent update of the session framework broke the functionality of pop. Please see #4729 for more information.

As for the loglevels, I'm -1. I think that this was discussed on the django-dev list for the User-based message framework... you might want to check there. If not, you should bring it up. I think that it's important to keep both the Session message framework and User message framework functionality the same.

10/11/07 04:47:20 changed by david

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com.

10/23/07 07:51:12 changed by msaelices

  • attachment visitor_messages_r6596.upatch added.

Updated patch for revision 6596

10/23/07 09:44:20 changed by msaelices

  • attachment visitor_messages_r6596.patch added.

Updated patch for revision 6596

10/28/07 15:22:24 changed by anonymous

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de.

11/07/07 15:05:59 changed by Thomas Steinacher <tom@eggdrop.ch>

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch.

-1 for loglevels

11/16/07 14:15:47 changed by Andrew Badr <andrewbadr.etc@gmail.com>

  • cc deleted.

11/16/07 14:16:35 changed by Andrew Badr <andrewbadr.etc@gmail.com>

  • cc set to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com.

11/16/07 17:12:18 changed by anonymous

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com.

11/17/07 17:35:24 changed by niels

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, niels.busch@gmail.com.

12/02/07 13:24:43 changed by __hawkeye__

  • owner changed from nobody to __hawkeye__.
  • needs_better_patch set to 1.
  • status changed from new to assigned.
  • stage changed from Design decision needed to Accepted.

Marking this as Accepted based on discussion at the 12/1/2007 sprint in Lawrence. I'm claiming it for now, and will work on it over the coming week or so.

We need to come up with an interface that gracefully allows use of both auth messages and sessions messages. I have some ideas on how to do this and will write them up here if I don't get around to implementing them in the next week or two.

12/02/07 13:52:30 changed by SmileyChris

Hawkeye, wanna email me (@gmail) to discuss this?

12/09/07 05:44:34 changed by anonymous

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, niels.busch@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, niels.busch@gmail.com, django@apolloner.eu.

12/09/07 20:57:47 changed by SmileyChris

  • attachment messages.diff added.

Rewritten version, new core context processor which grabs messages from both user and session

12/09/07 20:59:24 changed by SmileyChris

  • needs_better_patch deleted.

Ok, here's a rewritten version which matches the requirements which hawkeye discussed with me via email.

If some people want to have a play with it and report back, that'd be swell :)

12/09/07 21:02:52 changed by SmileyChris

Note that if you want the admin messages to work still and you have specified a TEMPLATE_CONTEXT_PROCESSORS in your own settings module, you'll need to ensure you add the new context processor to it.

This will need to be mentioned in BackwardsIncompatibleChanges.

(follow-up: ↓ 33 ) 12/13/07 11:49:23 changed by __hawkeye__

Patch looks good overall.

Three quick points:

  1. The documentation seems to focus on authenticated versus anonymous. I see this as synchronous (session) versus asynchronous (user) messaging.
  2. You import memoize and lazy into django.core.context_processors, but it doesn't look like you're using either.
  3. There currently aren't any tests for the LazyMessages class. I'd feel more comfortable if they were there.

(in reply to: ↑ 32 ) 12/13/07 13:19:26 changed by SmileyChris

Replying to __hawkeye__:

Patch looks good overall. Three quick points: 1. The documentation seems to focus on authenticated versus anonymous. I see this as synchronous (session) versus asynchronous (user) messaging.

It uses the terms "user messages" and "session messages". I'm not sure that calling this synchronous/asynchronous would make it any clearer.

The line "The session message system provides a simple way to queue messages for all (anonymous or authenticated) site visitors" is just there to explain synchronosity (my imaginary word of the day).

2. You import memoize and lazy into django.core.context_processors, but it doesn't look like you're using either.

Indeed I'm not. I was going to use them but in the end just wrote the LazyMessages class, due to the fact that lazy() isn't useful for non-string classes.

3. There currently aren't any tests for the LazyMessages class. I'd feel more comfortable if they were there.

Sure... now I just have to figure out where to stick them.

12/13/07 21:41:57 changed by SmileyChris

  • attachment messages.2.diff added.

More tests

12/13/07 21:47:34 changed by SmileyChris

  • attachment messages.3.diff added.

removed unnecessary imports

12/13/07 21:50:42 changed by SmileyChris

Ok, new tests in now. This patch also adds a new empty tests/middleware/models.py file, since those tests (which do pass) weren't actually being run due to the lack of this file.

12/14/07 08:11:07 changed by __hawkeye__

  • attachment messages.4.diff added.

Slight documentation change.

12/14/07 08:12:06 changed by __hawkeye__

  • stage changed from Accepted to Ready for checkin.

Made a slight documentation change, but this patch looks good to me. Patch applies cleanly, passes tests and works in my limited testing.

Thanks, SmileyChris?, for this latest patch.

12/17/07 14:20:12 changed by SmileyChris

I have been considering the fact that this is quite a big incompatible change (if you have overridden the context processors setting, you'll have to add the messages processor in to retain your admin message functionality).

I was thinking that perhaps the admin processor should check to see if messages has been turned on, and if not then continue treating the (user) messages like it currently does. This would be tricky to document and I'm not sure how much I'm allowed to "rock the boat" with this change, so I'll wait for a committer comment before worrying about adding that (it wouldn't be too difficult, anyway)

12/17/07 22:25:23 changed by anonymous

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, niels.busch@gmail.com, django@apolloner.eu to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, niels.busch@gmail.com, django@apolloner.eu, ross@rossp.org.

(follow-up: ↓ 41 ) 12/18/07 22:14:20 changed by mtredinnick

  • needs_better_patch set to 1.
  • stage changed from Ready for checkin to Accepted.

A couple of stylistic issues (all in the LazyMessages class):

  1. Subclass from django.utils.encoding.StrAndUnicode so that you get a __str__ method.
  2. Probably better form to call iter(self.messages), rather than calling self.messages.__iter__() directly. Use the interface, not the implementation (seems to be the python-dev-preferred approach, too). I prefer the way you've implemented __len__ to the __iter__ implementation, in other words.
  3. Blank lines are needed between the methods in that class.

I don't have a strong opinion about the move to the context processor at the moment, although you're correct that it's of some concern. Adding code that tries to work with both old- and new-style is something we generally avoid doing, because in the long-term it's just bloat and there's never a good moment to remove it (particularly if 1.0 was released in the interim, so you might as well do it up-front). It's hard to make things fail with an exception if somebody forgets, too. I feel that this is a bit like the old "compulsory middleware" stuff: it's a bit of an oxymoron. If we really need that processor, which we do because admin needs it, then it shouldn't be in any way optional. I haven't wrapped my brain around why it can't be called all the time yet.

My secret hope is that another maintainer will adopt this, since this isn't too high on my priority list, but it looks like it's getting towards some sort of completion point, so we should keep it on the radar.

01/03/08 15:14:41 changed by SmileyChris

  • owner changed from __hawkeye__ to SmileyChris.
  • status changed from assigned to new.

01/16/08 12:46:42 changed by Guilherme M. Gondim (semente) <semente@taurinus.org>

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, niels.busch@gmail.com, django@apolloner.eu, ross@rossp.org to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, niels.busch@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org.

01/19/08 19:06:28 changed by SmileyChris

  • attachment messages.5.diff added.

Now with better backwards compatibility

(in reply to: ↑ 38 ) 01/19/08 19:10:58 changed by SmileyChris

  • needs_better_patch deleted.
  • stage changed from Accepted to Ready for checkin.

Replying to mtredinnick:

A couple of stylistic issues (all in the LazyMessages class):

All addressed - thanks for the django.utils.encoding.StrAndUnicode tip.

I don't have a strong opinion about the move to the context processor at the moment, although you're correct that it's of some concern.

I have now made the auth processor work like it did before (in as much as it adds a messages variable) and changed the messages processor to not be enabled by default.

So now we have better backwards compatibility and everyone can hold hands and dance around together.

01/22/08 16:20:15 changed by SmileyChris

  • attachment messages.5.2.diff added.

identical to previous, except has empty init.py and models.py files for tests

01/22/08 16:20:41 changed by SmileyChris

  • attachment messages.6.diff added.

identical to previous, except has empty init.py and models.py files for tests (no, really this time)

01/31/08 20:47:31 changed by SmileyChris

  • attachment messages.7.diff added.

implement __getitem__ too, some people are using stuff like {{ messages.0 }}

02/07/08 04:58:07 changed by Manoj Govindan <egmanoj@gmail.com>

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, niels.busch@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, niels.busch@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com.

03/13/08 08:21:07 changed by jedie

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, niels.busch@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, niels.busch@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de.

04/19/08 13:36:45 changed by anonymous

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, niels.busch@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, niels.busch@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com.

06/17/08 20:22:26 changed by anonymous

  • milestone set to 1.0 beta.

07/12/08 08:30:43 changed by mtredinnick

  • milestone deleted.

Removing 1.0-beta tag. It might make it in or it might not, but it's not on the "maybe" list and there's enough stuff to do that we have to guard that milestone setting carefully.

07/13/08 18:32:41 changed by anonymous

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, niels.busch@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, niels.busch@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com.

07/14/08 02:10:51 changed by niels

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, niels.busch@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com.

07/16/08 20:35:52 changed by technel

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, contact@michaelschreifels.com.

07/18/08 05:41:22 changed by Viktor

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, contact@michaelschreifels.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, contact@michaelschreifels.com, viktor.nagy@gmail.com.

08/01/08 16:02:18 changed by __hawkeye__

  • milestone set to post-1.0.

Spoke with Malcolm... looks like there's hesitation to do this currently (and somewhat in general).

08/01/08 17:29:58 changed by technel

hawkeye,

That is really disappointing to hear. What is the source of hesitation (beyond being a non-priority for 1.0)? Personally, I think it's pretty obvious that this is a necessary feature. (I mean, really it's just a better implementation of the currently existing message passing system.)

08/11/08 13:56:50 changed by msaelices

I think this feature is quite useful in every communication with anon users of your website: contact form (sent contact info sucessfully), newsletter (thanks for joining newletter), ...

Why don't commit this? it isn't a huge refactoring.

08/14/08 11:21:26 changed by john

  • attachment messages-r8347.diff added.

Updated messages.7.diff to avoid rejects with django.core.context_processors.py

08/14/08 11:28:17 changed by john

Just chiming in to say that I find this really useful, and hope it does make it in after 1.0's done and dusted.

08/20/08 16:41:00 changed by gonz

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, contact@michaelschreifels.com, viktor.nagy@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, contact@michaelschreifels.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy.

08/22/08 15:01:35 changed by tobias

To me it makes no sense to store messages with a short lifetime in user.message_set. user.message_set should be reserved for system or administrator messages to the user. The session is the right place to store feedback about the current session for the user.

What if, for example, the same user is logged in from two different browsers and completing two different tasks, simultaneously? When using user.message_set to store feedback for the user, the messages will be distributed on a first come first served basis, with no regard for what session actually generated what feedback. It's bad to get in the habit of using user.message_set for messages like "Article updated successfully," or other messages that really have no context outside the current session.

For these reasons, I think this patch erroneously conflates user messages and session messages.

08/22/08 15:04:07 changed by technel

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, contact@michaelschreifels.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy.

(follow-up: ↓ 96 ) 08/23/08 17:39:05 changed by Travis Cline

FYI I took ideas from the patch and separated it into middleware: http://www.djangosnippets.org/snippets/1002/

Also added optional type for messages so you render them differently (e.g. http://traviscline.com/blog/2008/08/23/django-middleware-session-backed-messaging/)

08/26/08 12:51:04 changed by Jakub Wilk <ubanus@users.sf.net>

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net.

08/28/08 22:23:14 changed by anonymous

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com.

09/11/08 04:55:18 changed by lemuelf

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org.

09/16/08 09:47:09 changed by danfairs

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com.

(follow-up: ↓ 64 ) 09/17/08 01:11:53 changed by mtredinnick

  • needs_better_patch set to 1.
  • stage changed from Ready for checkin to Accepted.
  • milestone deleted.

Moving back from "ready for checkin", because I don't think it is yet. I suspect the new lazy() from r8120 is probably more reusable here. The duplicate lazy stuff makes me nervous.

I don't like the backwards compatibility this brings to the table. This is probably something that's relatively orthogonal to the existing stuff. I'm also not wild about it being in core, rather than a contrib app, since whilst it's useful sometimes and meets the "a reasonably common pattern", it's hardly impossible to use Django without it.

Right now, it's really suffering from not having any core maintainer having fallen in love with the idea and/or implementation enough. For me, a clean implementation that was low-impact on other pieces of code and backwards compatible and optional (part of contrib) would be more palatable. I haven't really seen much in the way of comment from any other core committer. I realise a fair bit of work has gone into this, but it doesn't feel like it's there yet. Solve the backwards incompatibility problem (not breaking existing admin, particularly) and work out how it could be part of contrib somewhere (contrib/auth maybe?) and it will have a better chance or proceeding. The fact that it impacts contrib/sessions also makes me wonder if the implementation is really correct. It's really being baked into the code in a few places. We must be able to do better than that.

(in reply to: ↑ 63 ) 09/25/08 19:20:45 changed by SmileyChris

Replying to mtredinnick:

Moving back from "ready for checkin", because I don't think it is yet. I suspect the new lazy() from r8120 is probably more reusable here. The duplicate lazy stuff makes me nervous.

That's fine - back when I started lazy() didn't do a very good job.

I don't like the backwards compatibility this brings to the table. This is probably something that's relatively orthogonal to the existing stuff. I'm also not wild about it being in core, rather than a contrib app, since whilst it's useful sometimes and meets the "a reasonably common pattern", it's hardly impossible to use Django without it.

It's only "in core" as much as the auth context processor is. And that is only required if you want messages and aren't using the auth context processor. I guess it could have it's own contrib app but it would only consist of a context processor!

Solve the backwards incompatibility problem (not breaking existing admin, particularly)

What backwards incompatibility? It won't break existing admin.

... and work out how it could be part of contrib somewhere (contrib/auth maybe?) and it will have a better chance or proceeding. The fact that it impacts contrib/sessions also makes me wonder if the implementation is really correct.

The whole point is that this is a session message system. It seems obvious to bake it into contrib/sessions to me.

The context processor just provides a single message context variable containing both (existing) user messages and (new) session messages. This keeps backwards compatibility with the current message system (and admin). However, as it has been noted by tobias, the admin is currently doing the wrong thing and should really be updated to using a session based messaging system.

10/02/08 18:15:05 changed by SmileyChris

  • summary changed from Message Passing For Anonymous Users to session-based messages.

10/24/08 04:13:03 changed by zgoda

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, jarek.zgoda@gmail.com.

11/04/08 16:28:07 changed by anonymous

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, jarek.zgoda@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, jarek.zgoda@gmail.com, hwaara@gmail.com.

11/04/08 20:58:30 changed by siddhi

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, jarek.zgoda@gmail.com, hwaara@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, jarek.zgoda@gmail.com, hwaara@gmail.com, siddhartag@hotmail.com.

12/03/08 11:40:05 changed by anonymous

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, jarek.zgoda@gmail.com, hwaara@gmail.com, siddhartag@hotmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, jarek.zgoda@gmail.com, hwaara@gmail.com, siddhartag@hotmail.com, tonn81@gmail.com.

01/05/09 07:28:12 changed by ramiro

  • attachment t4604-r9698.diff added.

Patch updated to r9698.

01/05/09 07:34:05 changed by ramiro

I've updated SmileyChris' messages.7.diff to trunk as of now (messages-r8347.diff was missing three files).

01/16/09 12:42:19 changed by izibi

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, jarek.zgoda@gmail.com, hwaara@gmail.com, siddhartag@hotmail.com, tonn81@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, jarek.zgoda@gmail.com, hwaara@gmail.com, siddhartag@hotmail.com, tonn81@gmail.com, julian@xairro.com.

02/15/09 20:32:11 changed by daniel_martins

Maybe it's a good idea to take a look at Django-flash, an open source app that provides an implementation that works pretty much like the Rails one:

http://djangoflash.destaquenet.com/

I'm the Django-flash's lead developer, and I'd be more than happy to see it bundled with Django.

(follow-up: ↓ 76 ) 02/26/09 10:41:15 changed by anonymous

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, jarek.zgoda@gmail.com, hwaara@gmail.com, siddhartag@hotmail.com, tonn81@gmail.com, julian@xairro.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, jarek.zgoda@gmail.com, hwaara@gmail.com, siddhartag@hotmail.com, tonn81@gmail.com, julian@xairro.com, flosch@gmail.com.

02/28/09 13:43:46 changed by jacob

  • milestone set to 1.2.

03/19/09 17:12:42 changed by david

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, larlet@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, jarek.zgoda@gmail.com, hwaara@gmail.com, siddhartag@hotmail.com, tonn81@gmail.com, julian@xairro.com, flosch@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, jarek.zgoda@gmail.com, hwaara@gmail.com, siddhartag@hotmail.com, tonn81@gmail.com, julian@xairro.com, flosch@gmail.com.

(in reply to: ↑ 73 ) 05/18/09 18:41:08 changed by leahculver

Replying to anonymous:

I just posted to the mailing list without seeing that you've commented here: http://groups.google.com/group/django-developers/browse_thread/thread/1ad495e30f946b2c/f6501a9e2a66e1d0

I've been using django-flash and I like it a lot. Maybe an actual Django patch with flash as a contrib app and proper Django documentation and such would be helpful in getting more support for this implementation?

06/01/09 22:29:03 changed by SmileyChris

I realise now that my efforts towards integrating with current user messages in a backwards-compatible manor is a waste of time.

Since that was the only reason to have the code here I have now started a separate app to do session/cookie based user notifications. This app supersedes the patches in this ticket (and would be dead easy to convert to a contrib app if this is ever wanted - which I think it should be, as it is a good example for something which there should be one right way [for most cases] to do).

You can find it here: http://code.google.com/p/django-notify/

I haven't done tests yet, but am willing to accept contributions ;)

06/04/09 10:14:00 changed by daniel_martins

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, jarek.zgoda@gmail.com, hwaara@gmail.com, siddhartag@hotmail.com, tonn81@gmail.com, julian@xairro.com, flosch@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, jarek.zgoda@gmail.com, hwaara@gmail.com, siddhartag@hotmail.com, tonn81@gmail.com, julian@xairro.com, flosch@gmail.com, daniel.tritone@gmail.com.
  • owner changed from SmileyChris to daniel_martins.
  • status changed from new to assigned.

Django-flash codebase is quite stable and it is fully documented and tested (all possible use cases are tested both in unit and integration tests), so I think the code is fine right now. I obviously don't know how many people are actually using it in their projects, but I know some of them who are quite happy with it. And I am too, since I created django-flash to scratch my own itch!

If you guys think django-flash would be a nice addition to Contrib (I think it is!), just get the code and use it the way you want, seriously. The project is currently licensed under LGPL, but I don't think it is a problem. (if it is, I can just dual license the project.)

As I said before, I'd be more than happy to see django-flash bundled with Django. Unfortunately, I will not send patches and work on a Django-style documentation before I get the green light.

06/04/09 15:31:27 changed by miracle2k

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, elsdoerfer@gmail.com, pedro.lima@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, jarek.zgoda@gmail.com, hwaara@gmail.com, siddhartag@hotmail.com, tonn81@gmail.com, julian@xairro.com, flosch@gmail.com, daniel.tritone@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, pedro.lima@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, jarek.zgoda@gmail.com, hwaara@gmail.com, siddhartag@hotmail.com, tonn81@gmail.com, julian@xairro.com, flosch@gmail.com, daniel.tritone@gmail.com.

06/04/09 16:32:00 changed by anonymous

The problem is that django-flash doesn't really encapsulate the requirements for a standard session based messaging system since it doesn't enforce a single way of using messages, so there is no way for third party apps to provide messages in a consistent manor.

This doesn't mean that I don't think it is a well developed or useful application, I'm just saying that I don't think on its own it works as a notification system.

As an unimportant personal aside, I don't like the name "flash".

06/04/09 19:09:19 changed by daniel_martins

I know what you mean. Although django-flash fulfills its purpose, this "flash" thing is probably just a subset of a full-fledged notification system.

Now I ask you: what exactly should a notification system do? Depending on the context, a notification system should do different things, at different levels of abstraction. So unless you define what a notification system should do, such term as "notification system" is just too general and creates more confusion than it helps.

I think we are missing the point here. The "flash" thing is part of Rails since the old days, and it continues to prove its usefulness. It is also general enough to cover the common cases. I might be biased, but I personally don't know anybody who dislikes the Rails' "flash" thing or thinks it's not great the way it is.

And, by the way, I don't like the name "flash" either, but that name happened to be used by several other web frameworks and became the standard way to describe such context or scope. So I think we should stick with that name and make everybody's life easier.

06/04/09 22:02:23 changed by SmileyChris

Oops, wasn't logged in before (in comment 80).

Actually, I'd say flash is a superset of the notification system that's being discussed in this ticket. All we're after is an alternative to storing messages in the User - so what we want is to encapsulate this behaviour, but in a standard way. The only frequently requested addition is the ability to have messages which can have different HTML classes.

Oh, and another request from several parties was to allow these messages without causing a hit on the database: django-notify comes with an alternate cookie storage backend you can use for this.

06/18/09 17:57:08 changed by leahculver

  • owner changed from daniel_martins to leahculver.
  • status changed from assigned to new.

I'm going to take a stab at converting django-flash + django-notify into something that looks like a contrib app with docs and tests. Let me know if you'd like to help! I think sticking with the "flash" name, although it sucks, will end up being a good thing.

06/18/09 18:08:03 changed by SmileyChris

leah: Personally I wouldn't bother the conversion until the issue is discussed a bit more in django-dev - and that discussion would best wait until after 1.1

But if you still need some help after then, I'd be more than happy. Let's just get a solution!

(follow-up: ↓ 86 ) 06/18/09 22:36:50 changed by tobias

Ditto on helping out. I realize that django-flash may be closely following a convention with which I'm not familiar, but I don't like it for two reasons:

# It doesn't have an obvious, standard method for storing 2+ separate messages # If the second request generates a redirect (or is another view that doesn't print session messages), and that view doesn't know about django-flash, you'll lose your messages

For these reasons I like django-notify better. It provides a standard way to store/retrieve multiple messages, and those messages aren't erased until they're actually printed in the template.

At least, that's my limited understanding of it. Just my two cents...

(in reply to: ↑ 85 ) 06/19/09 07:00:12 changed by daniel_martins

Replying to tobias:

# It doesn't have an obvious, standard method for storing 2+ separate messages

Just use Python! There's nothing more "obvious and standard" than a plain List to store several messages under a single key:

request.flash['message'] = ['Message one', 'Message two']

I like this approach because we are being explicit that there's multiple messages under the same key. (Remember the Zen of Python, which says "Explicit is better than implicit.")

# If the second request generates a redirect (or is another view that doesn't print session messages), and that view doesn't know about django-flash, you'll lose your messages

If you want flash messages to survive a redirect:

def view1(request):
    request.flash['message'] = 'My message'
    return HttpRedirectResponse(reverse(view2))

def view2(request):
    request.keep() # Keeps all messages stored inside the flash
    request.keep('message1', 'message2') # Only keeps the given messages
    return HttpRedirectResponse(reverse(final_view))

I personally think it's a feature, not a bug or something like that for the same reason: "Explicit is better than implicit".

Another reason is that we avoid propagating undesired messages by accident, since we might store stuff inside the flash to be retrieved by other views, not templates. It's rare, but it's possible.

06/19/09 08:00:56 changed by daniel_martins

Ooops, fixing some typos in the code:

def view1(request):
    request.flash['message1'] = 'My message'
    return HttpRedirectResponse(reverse(view2))

def view2(request):
    request.flash.keep() # Keeps all messages stored inside the flash
    request.flash.keep('message1', 'message2') # Only keeps the given messages
    return HttpRedirectResponse(reverse(final_view))

(follow-up: ↓ 89 ) 06/19/09 11:40:01 changed by tobias

  • flash['message'] = ['1', '2'] is too flexible. You might have a project with one pluggable app that just sets flash['message'] = 'message', another that does flash['message'].append('message'), and yet another that does flash['message'] = ('message 1', 'message 2'). And if you want to append, who's responsible for creating the list in the first place? As far as I can tell from the docs, django-flash doesn't propose a convention for doing this. Maybe it's just me, but notifications.add('message') seems much more explicit...
  • request.keep is all well and good for your own tightly integrated code, but what if you're dealing with a view in a pluggable app that you can't modify, and it doesn't know about django-flash?
  • WRT propagating undesired messages, as far as I can tell django-notify (and I believe at least one of the patches on this ticket) only destroys messages when iterated (from a template OR a view). I'm not exactly clear about your concern but would that address it?

I tried to sum up some of my points about what would comprise a good contrib app here: http://www.caktusgroup.com/blog/2009/06/19/towards-a-standard-for-django-session-messages/

(in reply to: ↑ 88 ; follow-up: ↓ 91 ) 06/19/09 12:15:16 changed by daniel_martins

Replying to tobias:

* flash['message'] = ['1', '2'] is too flexible. You might have a project with one pluggable app that just sets flash['message'] = 'message', another that does flash['message'].append('message'), and yet another that does flash['message'] = ('message 1', 'message 2'). And if you want to append, who's responsible for creating the list in the first place? As far as I can tell from the docs, django-flash doesn't propose a convention for doing this. Maybe it's just me, but notifications.add('message') seems much more explicit...

Storing several messages under the same key is not the rule, but the exception, at least for the projects I work on. But once you treat the flash as a regular dictionary (in fact their interface are very similar), things become easier to grasp. But, for the record, I have no problem with the ".add('message')" thing.

* request.keep is all well and good for your own tightly integrated code, but what if you're dealing with a view in a pluggable app that you can't modify, and it doesn't know about django-flash?

This is a very good point. I haven't thought about this until now. I'll try to come up with something.

* WRT propagating undesired messages, as far as I can tell django-notify (and I believe at least one of the patches on this ticket) only destroys messages when iterated (from a template OR a view). I'm not exactly clear about your concern but would that address it?

Yes it does, if that's really the case. The only thing I don't like about it is the idea of getting my messages removed when doing something like "request.flashmessage?" in my views.

06/19/09 13:10:23 changed by waltercruz

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, pedro.lima@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, jarek.zgoda@gmail.com, hwaara@gmail.com, siddhartag@hotmail.com, tonn81@gmail.com, julian@xairro.com, flosch@gmail.com, daniel.tritone@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, pedro.lima@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, jarek.zgoda@gmail.com, hwaara@gmail.com, siddhartag@hotmail.com, tonn81@gmail.com, julian@xairro.com, flosch@gmail.com, daniel.tritone@gmail.com, walter.php@gmail.com.

(in reply to: ↑ 89 ) 06/19/09 13:40:22 changed by tobias

Replying to daniel_martins:

Storing several messages under the same key is not the rule, but the exception, at least for the projects I work on. But once you treat the flash as a regular dictionary (in fact their interface are very similar), things become easier to grasp. But, for the record, I have no problem with the ".add('message')" thing.

It has nothing to do with being easier to grasp. The issue is that django-flash does not propose a singular, standard structure for creating and retrieving 2+ messages. The very fact that it's a dictionary leaves too much as an "exercise for the reader."

06/19/09 14:40:46 changed by miracle2k

It has nothing to do with being easier to grasp. The issue is that django-flash does not propose a singular, standard structure for creating and retrieving 2+ messages. The very fact that it's a dictionary leaves too much as an "exercise for the reader."

Without having actually tried django-flash: How so? If it's a dictionary, then the interface is pretty clear: It's the same interface as the standard python dict, possibly with some goodies on top of it. How does it matter if you use [] or update() to add messages?

I'm chiming in here because I would really like to see multiple **types** of messages supported, e.g. "error", "notice" etc. Using a dict seems fitting then.

06/19/09 14:52:07 changed by zgoda

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, pedro.lima@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, jarek.zgoda@gmail.com, hwaara@gmail.com, siddhartag@hotmail.com, tonn81@gmail.com, julian@xairro.com, flosch@gmail.com, daniel.tritone@gmail.com, walter.php@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, pedro.lima@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, hwaara@gmail.com, siddhartag@hotmail.com, tonn81@gmail.com, julian@xairro.com, flosch@gmail.com, daniel.tritone@gmail.com, walter.php@gmail.com.

06/19/09 15:37:05 changed by tobias

Multiple message types sounds good to me. A dict probably makes sense behind the scenes, but I think it's exposing too much to make that the default interface for creating/retrieving messages.

06/19/09 15:39:41 changed by Alex

Guys, might I suggest a different venue for this discussion, trac is a pretty bad place for it, as it's not as easily searchable, and it's visible to a smaller cut of individuals.

(in reply to: ↑ 58 ) 08/01/09 08:11:39 changed by ckarrie

Replying to Travis Cline:

FYI I took ideas from the patch and separated it into middleware: http://www.djangosnippets.org/snippets/1002/ Also added optional type for messages so you render them differently (e.g. http://traviscline.com/blog/2008/08/23/django-middleware-session-backed-messaging/)

seems to be the same idea as 11617: Enhance User Message System

09/10/09 17:37:51 changed by tobias

django-notify has a combo/fallback backend now:

http://code.google.com/p/django-notify/issues/detail?id=5

09/10/09 18:29:59 changed by tobias

per Alex's request I started a conversation on django-developers here:

http://groups.google.com/group/django-developers/browse_thread/thread/eba93088c649022b

10/11/09 18:31:19 changed by tobias

10/23/09 10:54:00 changed by tobias

Leah, do you mind if I claim this ticket? Are you still working on it? Thanks -tobias

10/23/09 12:31:03 changed by leahculver

  • owner changed from leahculver to tobias.

Here you go! Nice wiki page summary.

10/24/09 13:41:11 changed by tobias

  • status changed from new to assigned.

10/24/09 13:42:33 changed by tobias

development branch for proposed messages app is here: http://bitbucket.org/tobias.mcnulty/django-contrib-messages/

11/17/09 07:25:35 changed by tobias

  • attachment django-contrib-messages-9f54c0f8719c.diff added.

diff showing changes in django-contrib-messages branch as of changeset 9f54c0f8719c

11/20/09 09:44:47 changed by mikecampo

  • cc changed from goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, pedro.lima@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, hwaara@gmail.com, siddhartag@hotmail.com, tonn81@gmail.com, julian@xairro.com, flosch@gmail.com, daniel.tritone@gmail.com, walter.php@gmail.com to goliath.mailinglist@gmx.de, real.human@mrmachine.net, jshaffer2112@gmail.com, pedro.lima@gmail.com, hv@tbz-pariv.de, tom@eggdrop.ch, andrewbadr.etc@gmail.com, ashanks@gmail.com, django@apolloner.eu, ross@rossp.org, semente@taurinus.org, egmanoj@gmail.com, django@jensdiemer.de, grimdonkey@gmail.com, robert.hopson@gmail.com, viktor.nagy@gmail.com, gonz@webstudio.com.uy, ubanus@users.sf.net, oliver@bluelavatech.com, lemuelf@sectioneleven.org, dan.fairs@gmail.com, hwaara@gmail.com, siddhartag@hotmail.com, tonn81@gmail.com, julian@xairro.com, flosch@gmail.com, daniel.tritone@gmail.com, walter.php@gmail.com, mikecampo@gmail.com.

12/03/09 00:36:07 changed by tobias

  • attachment django-contrib-messages-e4da706e1152.diff added.

diff showing changes in django-contrib-messages branch as of changeset e4da706e1152

12/05/09 13:31:36 changed by tobias

  • attachment django-contrib-messages-6399c12d1773.diff added.

changes in django-contrib-messages branch as of rev 6399c12d1773

12/09/09 07:09:01 changed by tobias

  • attachment django-contrib-messages.2.diff added.

12/09/09 07:09:52 changed by tobias

  • attachment django-contrib-messages.diff added.

final patch from django-contrib-messages branch

12/09/09 10:57:23 changed by lukeplant

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [11804]) Fixed #4604 - Configurable message passing system, supporting anonymous users

This deprecates User.message_set in favour of a configurable messaging system, with backends provided for cookie storage, session storage and backward compatibility.

Many thanks to Tobias McNulty? for the bulk of the work here, with contributions from Chris Beaven (SmileyChris?) and lots of code review from Russell Keith-Magee, and input from many others. Also credit to the authors of various messaging systems for Django whose ideas may have been pinched :-)

01/22/10 00:47:16 changed by andrewbadr

Took me a minute to find the docs, so here they are if anyone else is looking: http://docs.djangoproject.com/en/dev/ref/contrib/messages/


Add/Change #4604 (session-based messages)




Change Properties
Action