On Thu, Dec 3, 2009 at 12:58 AM, Tobias McNulty <tob...@caktusgroup.com> wrote:
>
>
> On Tue, Dec 1, 2009 at 4:35 PM, Luke Plant <l.plant...@cantab.net> wrote:
>>
>> I just converted some code, and the API seems good to me.  I had one
>> issue, which was the fact that I had some code which only had access
>> to the User object, and not the request object, which had to be re-
>> plumbed.  The only place this change will be an issue is where it is
>> difficult to do that (e.g. if your code is being called from somewhere
>> else which you can't change).  There is no reason this should hold us
>> back - storing messages on the User is really a hack, and if people
>> have a problem with not being able to do it any more (i.e. in Django
>> 1.4), they can use other hacks like storing the request in threadlocal
>> storage.
>
> *gasp* Did I really just hear a core committer condoning threadlocals?
> Storing messages on the user was bad, but not that bad.  :)
>
>>
>> The simplest solution is to catch the exception in the generic views.
>> Another option is to add a 'fail_silently' keyword argument,
>> defaulting to False, like the mail sending API. It would need to be
>> added to all the shortcut functions, and used in the generic views and
>> anywhere that you cannot rely on there being a current authenticated
>> User.  Docs should include something about it being intended for re-
>> usable apps.
>
> Good catch.  fail_silently sounds good to me.  I'll add.
>
> Tobias
> --
> Tobias McNulty
> Caktus Consulting Group, LLC
> P.O. Box 1454
> Carrboro, NC 27510
> (919) 951-0052
> http://www.caktusgroup.com
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To post to this group, send email to django-develop...@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.
>

I haven't been paying as much attention to this thread as I should be
:(.  However, I just read through the diff that was uploaded, and I'm
curious why the decision to go with functions with APIs like
messages.info(request, msg).  Instead of request.messages.info(msg).
The latter reads far better to me.

Thanks,
Alex

-- 
"I disapprove of what you say, but I will defend to the death your
right to say it." -- Voltaire
"The people's good is the highest law." -- Cicero
"Code can always be simpler than you think, but never as simple as you
want" -- Me

--

You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@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