On 7/9/07, Marty Alchin <[EMAIL PROTECTED]> wrote:
> There was some discussion on this a while back, and my main concern
> with that, is whether or not those are sufficient for everybody. For
> instance, many projects would probably benefit more from "success" and
> "failure" info than the ones you mention.
>
> I'm not sure there's a way to make everybody (or even a majority)
> happy on this. It's worth trying, but I'm not holding my breath.

You could just leave it as a unqualified tag/slug-style string (ie,
only characters useful in identifiers and space-separated when
multiple values), and leave it to template writers to decide how they
want to handle it, with the most useful two options being something
like:

<div class="message">[{{ message.level }}] {{ message }}</div>

versus

<div class="message {{ message.level }}">{{ message }}</div>

In the first, the template writer is just passing the data straight
through to the user and doesn't care what values get passed back.  Add
an {% if message.level %} around the square brackets and the output
would be the same for classic/simple level-less messages.

In the second the template writer wants to style messages based on
level and here the writer can easily add CSS rules for the levels that
are interesting, such as:

.message .error, .message .failure {
  background: red;
}
.message .i-cant-believe-not-butter {
  background: chartreuse;
}

...and CSS allows them to provide a simple generic fall-back for the
cases when a template writer doesn't explicitly style a level.

Apps don't need to agree on levels as long as template writers don't
mind checking what levels an app might "throw".

So, basically I'm suggesting adding a tags or labels field rather than
a debug-style levels field.  Then let template writers decide how the
tags/labels might be used.

-- 
--Max Battcher--
http://www.worldmaker.net/

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to