Adding datetil to macros and documenting macros references

This commit is contained in:
Maxime 2015-11-19 16:40:16 +00:00
Родитель 66370f9290
Коммит 8fd35adb4f
2 изменённых файлов: 21 добавлений и 1 удалений

Просмотреть файл

@ -1,6 +1,7 @@
from __future__ import absolute_import
from random import random
from datetime import datetime, timedelta
import dateutil
import time
from . import hive
import uuid

Просмотреть файл

@ -138,7 +138,26 @@ attributes and methods.
Macros
''''''
These macros live under the ``macros`` namespace in your templates.
Macros are a way to expose objects to your templates and live under the
``macros`` namespace in your templates.
A few commonly used libraries and methods are made available.
================================= ====================================
Variable Description
================================= ====================================
``macros.datetime`` The standard lib's
``datetime.datetime``
``macros.timedelta`` The standard lib's
``datetime.timedelta``
``macros.dateutil`` A reference to the ``dateutil``
package
``macros.time`` The standard lib's ``time``
``macros.uuid`` The standard lib's ``uuid``
``macros.random`` The standard lib's ``random``
================================= ====================================
Some airflow specific macros are also defined:
.. automodule:: airflow.macros
:show-inheritance: