On Tue, Oct 13, 2009 at 9:48 AM, Jacob Kaplan-Moss <ja...@jacobian.org> wrote:
> The best solution, I think, would be to implement user messages
> (user.message_set, get_and_delete_messages, etc) in terms of the new
> framework, and then gradually deprecate and remove the old APIs.

On Tue, Oct 13, 2009 at 10:30 PM, Tobias McNulty <tob...@caktusgroup.com> wrote:
> I'm not sure exactly what you mean by implement user messages in terms
> of the new framework.  It is completely possible to implement a
> storage engine in several of the proposed solutions that would use
> user.message_set to store data, though I'm not sure what the advantage
> would be over any of the other options.  Furthermore, the fact that
> user.message_set is just a related manager on a model and not an
> independent API per se makes it a difficult one to remove while
> simultaneously keeping user message functionality.

I took what Jacob said to be the opposite. It sounded to me like he
was suggesting that we keep the existing user messaging api, but
change the internals of it to use the new notifications framework for
storage. In my head it goes something like:

1. Remove the relation from the User to the Message model.
2. Add a message_set property that mimics the related manager, but
which stores the messages via the new notifications app.
3. Modify the get_and_delete_messages method to retrieve messages from
the new app.
4. Gradually remove the messaging stuff from contrib.auth all together.

This has the advantage of removing the need to modify
core.context_managers.auth since that just uses
User.get_and_delete_messages.

I think this method is nice and clean, backward compatible as far as
the API goes, and moves all messaging into a single backend w/o
disrupting existing view or template code. It may break things if
people are directly querying the Message model, but that has to be
extremely rare.

Paul

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to