builtin (4)
cycler¶
cycler(*items: Any) -> None
Cycle through values by yield them one at a time, then restarting
Example
Jinja call:
{% set row_class = cycler("odd", "even") %}
{{ row_class.next() }}
{{ row_class.next() }}
{{ row_class.next() }}
{{ row_class.current }}
odd
even
odd
even
DocStrings
Source code in .venv/lib/python3.12/site-packages/jinja2/utils.py
666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 |
|
next
¶
next() -> Any
Source code in .venv/lib/python3.12/site-packages/jinja2/utils.py
709 710 711 712 713 714 715 |
|
reset
¶
reset() -> None
Source code in .venv/lib/python3.12/site-packages/jinja2/utils.py
698 699 700 |
|
joiner¶
joiner(sep: str = ', ') -> None
A joining helper for templates.
Example
Jinja call:
Result: `"AB""AB" | "AB" |`
DocStrings
Source code in .venv/lib/python3.12/site-packages/jinja2/utils.py
720 721 722 723 724 725 726 727 728 729 730 731 |
|
lipsum¶
lipsum(n: int = 5, html: bool = True, min: int = 20, max: int = 100) -> str
Generate some lorem ipsum for the template.
Example
Jinja call:
Result:<p>Dui magna consequat massa elementum, in neque vel tellus blandit, torquent lobortis pretium sociosqu vivamus, magnis hymenaeos porttitor magna habitasse, ipsum. Viverra augue viverra molestie potenti, ut placerat faucibus urna arcu neque potenti, suscipit mattis nunc faucibus, dictumst. Porta ipsum odio curae torquent montes magnis, nisi orci etiam parturient pharetra senectus augue, magna donec ultrices sociosqu turpis, condimentum praesent. Montes feugiat facilisis amet accumsan, ante magna at augue inceptos, ac commodo integer litora mus eros et,. Laoreet lacinia lacus erat urna.</p>
<p>Ullamcorper mus congue lacinia fermentum, scelerisque fermentum vivamus mollis mattis cursus, tincidunt nullam aliquet aptent, nam justo volutpat congue id ad turpis,. Iaculis euismod augue arcu, integer mi tempor consequat feugiat platea auctor, leo taciti pellentesque felis litora, hac tristique tempus.</p>
<p>Donec ligula duis nisi nullam, consequat placerat congue fringilla mollis rhoncus, suspendisse natoque faucibus elementum convallis, arcu lorem nam duis nulla sapien. Ante blandit consequat nullam placerat, curae fusce potenti proin, parturient sit condimentum ante vel, placerat malesuada rhoncus.</p>
<p>Tempor diam euismod viverra hac turpis nec, vestibulum laoreet ridiculus consectetuer, facilisis ligula nam tincidunt eros sit habitant. Mattis commodo volutpat inceptos ligula facilisi elementum, donec nonummy convallis netus non.</p>
<p>Duis condimentum mauris nullam hac nisl, purus adipiscing vehicula fermentum, rhoncus torquent scelerisque adipiscing fames, molestie tortor ad dis. Augue mi mauris euismod posuere platea adipiscing, netus condimentum class morbi hymenaeos placerat, pharetra magnis quam. Cum penatibus auctor faucibus nisi, fringilla vel facilisi magnis orci, dignissim nisl inceptos vitae, ridiculus.</p>
DocStrings
Source code in .venv/lib/python3.12/site-packages/jinja2/utils.py
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 |
|
namespace¶
namespace(*args: Any, **kwargs: Any) -> None
A namespace object that can hold arbitrary attributes. It may be
DocStrings
Source code in .venv/lib/python3.12/site-packages/jinja2/utils.py
734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 |
|