Django Book 翻译
菜单>:
TOC
返回
原文:
As you can see, ``{% regroup %}`` populates a variable with a list of objects with ``grouper`` and ``list`` attributes. ``grouper`` contains the item that was grouped by; ``list`` contains the list of objects that share that ``grouper`` . In this case, ``grouper`` would be ``Male`` , ``Female`` , and ``Unknown`` , and ``list`` is the list of people with those genders.
翻译:
如你所见, ``{% regroup %}`` 构造了一个列表变量,列表中的每个对象都有 ``grouper`` 和 ``list`` 属性。 ``grouper`` 包含分组所依据的属性, ``list`` 包含一系列拥有共同的 ``grouper`` 属性的对象。这样 ``grouper`` 就会是 ``Male`` 、 ``Female`` 和 ``Unknown`` , ``list`` 就是属于这几种性别的人们。
备注:
译者: