Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b05dd31ff0 | ||
|
|
16a26afdce |
@@ -6,6 +6,8 @@ Overview:
|
||||
- [advanced example](#advanced-example) touches on the potentials of the plugin.
|
||||
- [Misc](#misc) shows other use-cases.
|
||||
|
||||
After reading this tutorial, have a look at other plugins that use `lektor-groupby`:
|
||||
- [lektor-inlinetags](https://github.com/relikd/lektor-inlinetags-plugin)
|
||||
|
||||
|
||||
## About
|
||||
|
||||
@@ -74,8 +74,10 @@ class GroupByModelReader:
|
||||
'''
|
||||
assert isinstance(record, Record)
|
||||
for r_key, subs in self._models.get(record.datamodel.id, {}).items():
|
||||
if subs == '*': # either normal field or flow type (all blocks)
|
||||
field = record[r_key]
|
||||
if not field:
|
||||
continue
|
||||
if subs == '*': # either normal field or flow type (all blocks)
|
||||
if flatten and isinstance(field, Flow):
|
||||
for i, flow in enumerate(field.blocks):
|
||||
flowtype = flow['_flowblock']
|
||||
@@ -86,7 +88,7 @@ class GroupByModelReader:
|
||||
else:
|
||||
yield FieldKeyPath(r_key), field
|
||||
else: # always flow type (only some blocks)
|
||||
for i, flow in enumerate(record[r_key].blocks):
|
||||
for i, flow in enumerate(field.blocks):
|
||||
flowtype = flow['_flowblock']
|
||||
for f_key in self._flows.get(flowtype, []):
|
||||
yield FieldKeyPath(r_key, i, f_key), flow[f_key]
|
||||
|
||||
3
setup.py
3
setup.py
@@ -13,7 +13,7 @@ setup(
|
||||
},
|
||||
author='relikd',
|
||||
url='https://github.com/relikd/lektor-groupby-plugin',
|
||||
version='0.9.4',
|
||||
version='0.9.5',
|
||||
description='Cluster arbitrary records with field attribute keyword.',
|
||||
long_description=longdesc,
|
||||
long_description_content_type="text/markdown",
|
||||
@@ -27,7 +27,6 @@ setup(
|
||||
'cluster',
|
||||
],
|
||||
classifiers=[
|
||||
'Development Status :: 5 - Production/Stable',
|
||||
'Environment :: Web Environment',
|
||||
'Environment :: Plugins',
|
||||
'Framework :: Lektor',
|
||||
|
||||
Reference in New Issue
Block a user