Python jinja2.filters.groupby() Examples

The following are 17 code examples of jinja2.filters.groupby(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module jinja2.filters , or try the search function .
Example #1
Source File: asyncfilters.py    From Building-Recommendation-Systems-with-Python with MIT License 5 votes vote down vote up
def do_groupby(environment, value, attribute):
    expr = filters.make_attrgetter(environment, attribute)
    return [filters._GroupTuple(key, await auto_to_seq(values))
            for key, values in filters.groupby(sorted(
                await auto_to_seq(value), key=expr), expr)] 
Example #2
Source File: asyncfilters.py    From android_universal with MIT License 5 votes vote down vote up
def do_groupby(environment, value, attribute):
    expr = filters.make_attrgetter(environment, attribute)
    return [filters._GroupTuple(key, await auto_to_seq(values))
            for key, values in filters.groupby(sorted(
                await auto_to_seq(value), key=expr), expr)] 
Example #3
Source File: asyncfilters.py    From Carnets with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def do_groupby(environment, value, attribute):
    expr = filters.make_attrgetter(environment, attribute)
    return [filters._GroupTuple(key, await auto_to_seq(values))
            for key, values in filters.groupby(sorted(
                await auto_to_seq(value), key=expr), expr)] 
Example #4
Source File: asyncfilters.py    From EDCOP with Apache License 2.0 5 votes vote down vote up
def do_groupby(environment, value, attribute):
    expr = filters.make_attrgetter(environment, attribute)
    return [filters._GroupTuple(key, await auto_to_seq(values))
            for key, values in filters.groupby(sorted(
                await auto_to_seq(value), key=expr), expr)] 
Example #5
Source File: asyncfilters.py    From odoo13-x64 with GNU General Public License v3.0 5 votes vote down vote up
def do_groupby(environment, value, attribute):
    expr = filters.make_attrgetter(environment, attribute)
    return [filters._GroupTuple(key, await auto_to_seq(values))
            for key, values in filters.groupby(sorted(
                await auto_to_seq(value), key=expr), expr)] 
Example #6
Source File: asyncfilters.py    From PhonePi_SampleServer with MIT License 5 votes vote down vote up
def do_groupby(environment, value, attribute):
    expr = filters.make_attrgetter(environment, attribute)
    return [filters._GroupTuple(key, await auto_to_seq(values))
            for key, values in filters.groupby(sorted(
                await auto_to_seq(value), key=expr), expr)] 
Example #7
Source File: asyncfilters.py    From planespotter with MIT License 5 votes vote down vote up
def do_groupby(environment, value, attribute):
    expr = filters.make_attrgetter(environment, attribute)
    return [filters._GroupTuple(key, await auto_to_seq(values))
            for key, values in filters.groupby(sorted(
                await auto_to_seq(value), key=expr), expr)] 
Example #8
Source File: asyncfilters.py    From cadquery-freecad-module with GNU Lesser General Public License v3.0 5 votes vote down vote up
def do_groupby(environment, value, attribute):
    expr = filters.make_attrgetter(environment, attribute)
    return [filters._GroupTuple(key, await auto_to_seq(values))
            for key, values in filters.groupby(sorted(
                await auto_to_seq(value), key=expr), expr)] 
Example #9
Source File: asyncfilters.py    From scylla with Apache License 2.0 5 votes vote down vote up
def do_groupby(environment, value, attribute):
    expr = filters.make_attrgetter(environment, attribute)
    return [filters._GroupTuple(key, await auto_to_seq(values))
            for key, values in filters.groupby(sorted(
                await auto_to_seq(value), key=expr), expr)] 
Example #10
Source File: asyncfilters.py    From misp42splunk with GNU Lesser General Public License v3.0 5 votes vote down vote up
def do_groupby(environment, value, attribute):
    expr = filters.make_attrgetter(environment, attribute)
    return [filters._GroupTuple(key, await auto_to_seq(values))
            for key, values in filters.groupby(sorted(
                await auto_to_seq(value), key=expr), expr)] 
Example #11
Source File: asyncfilters.py    From Building-Recommendation-Systems-with-Python with MIT License 5 votes vote down vote up
def do_groupby(environment, value, attribute):
    expr = filters.make_attrgetter(environment, attribute)
    return [filters._GroupTuple(key, await auto_to_seq(values))
            for key, values in filters.groupby(sorted(
                await auto_to_seq(value), key=expr), expr)] 
Example #12
Source File: asyncfilters.py    From pySINDy with MIT License 5 votes vote down vote up
def do_groupby(environment, value, attribute):
    expr = filters.make_attrgetter(environment, attribute)
    return [filters._GroupTuple(key, await auto_to_seq(values))
            for key, values in filters.groupby(sorted(
                await auto_to_seq(value), key=expr), expr)] 
Example #13
Source File: asyncfilters.py    From OpenXR-SDK-Source with Apache License 2.0 5 votes vote down vote up
def do_groupby(environment, value, attribute):
    expr = filters.make_attrgetter(environment, attribute)
    return [filters._GroupTuple(key, await auto_to_seq(values))
            for key, values in filters.groupby(sorted(
                await auto_to_seq(value), key=expr), expr)] 
Example #14
Source File: asyncfilters.py    From RSSNewsGAE with Apache License 2.0 5 votes vote down vote up
def do_groupby(environment, value, attribute):
    expr = filters.make_attrgetter(environment, attribute)
    return [filters._GroupTuple(key, await auto_to_seq(values))
            for key, values in filters.groupby(sorted(
                await auto_to_seq(value), key=expr), expr)] 
Example #15
Source File: asyncfilters.py    From recruit with Apache License 2.0 5 votes vote down vote up
def do_groupby(environment, value, attribute):
    expr = filters.make_attrgetter(environment, attribute)
    return [filters._GroupTuple(key, await auto_to_seq(values))
            for key, values in filters.groupby(sorted(
                await auto_to_seq(value), key=expr), expr)] 
Example #16
Source File: asyncfilters.py    From recruit with Apache License 2.0 5 votes vote down vote up
def do_groupby(environment, value, attribute):
    expr = filters.make_attrgetter(environment, attribute)
    return [filters._GroupTuple(key, await auto_to_seq(values))
            for key, values in filters.groupby(sorted(
                await auto_to_seq(value), key=expr), expr)] 
Example #17
Source File: asyncfilters.py    From misp42splunk with GNU Lesser General Public License v3.0 5 votes vote down vote up
def do_groupby(environment, value, attribute):
    expr = filters.make_attrgetter(environment, attribute)
    return [filters._GroupTuple(key, await auto_to_seq(values))
            for key, values in filters.groupby(sorted(
                await auto_to_seq(value), key=expr), expr)]