Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)

        @register.inclusion_tag('messagegroups.html')
def render_messages(messages):
    grouped = defaultdict(set)
    for m in messages:
        tags = 'alert-{0} {1}'.format(TAGS[m.level], m.tags)
        grouped[(m.level, tags)].add(m.message)
    return {'messages': dict(grouped)}
        


src/d/j/django-messagegroups-HEAD/messagegroups/tests.py   django-messagegroups(Download)
from django.contrib.messages import constants
 
from templatetags.messagegroups import render_messages
 
 
        i1 = self.FakeMessage(constants.INFO, 'info')
 
        groups = render_messages([e1, e2, i1])
        self.assertEqual(groups, {'messages': {
            (40, 'alert-danger error'): set(['error1', 'error2']),

src/d/j/django-messagegroups-0.4.1/messagegroups/tests.py   django-messagegroups(Download)
from django.contrib.messages import constants
 
from templatetags.messagegroups import render_messages
 
 
        i1 = self.FakeMessage(constants.INFO, 'info')
 
        groups = render_messages([e1, e2, i1])
        self.assertEqual(groups, {'messages': {
            (40, 'alert-danger error'): set(['error1', 'error2']),