wolflu05 / inventree-bulk-plugin

A bulk creation plugin for InvenTree, which helps you generating locations, categories and even parts in bulk by using customized naming strategies and ensure them along your complete storage tree.
MIT License
17 stars 1 forks source link

Child len context #36

Closed wolflu05 closed 1 year ago

wolflu05 commented 1 year ago

This pr adds two new len attributes to the extended Jinja2 context which can be useful for giving the dimension a padding so that they are all equal length.

Example

{{dim.1.zfill(dim.1.len|string|length)}} can be used to pad the first dimension so that they are all of equal length

resolves #35

github-actions[bot] commented 1 year ago

Coverage Report

Code Coverage Name Stmts Miss Cover Missing
inventree_bulk_plugin/BulkGenerator/BulkGenerator.py 111 0 100%
inventree_bulk_plugin/BulkGenerator/dimensions.py 66 0 100%
inventree_bulk_plugin/BulkGenerator/generators/gen_alpha.py 36 0 100%
inventree_bulk_plugin/BulkGenerator/generators/gen_numeric.py 14 0 100%
inventree_bulk_plugin/BulkGenerator/generators/generator.py 33 0 100%
inventree_bulk_plugin/BulkGenerator/template.py 10 0 100%
inventree_bulk_plugin/BulkGenerator/utils.py 2 0 100%
inventree_bulk_plugin/BulkGenerator/validations.py 53 0 100%
inventree_bulk_plugin/InvenTreeBulkPlugin.py 122 0 100%
inventree_bulk_plugin/migrations/0001_initial.py 6 0 100%
inventree_bulk_plugin/models.py 21 0 100%
inventree_bulk_plugin/version.py 1 0 100%
TOTAL 475 0 100%