aboutsummaryrefslogtreecommitdiff
path: root/runserver.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2015-03-16 07:36:11 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2015-03-16 07:36:11 +0100
commitf322fba75c8ca3dd4296a11bda688d63b2a547d2 (patch)
tree0334f42f791202d184b4e932c88ac2e5c466a1da /runserver.py
parentRemoved blank line. (diff)
downloadnewspipe-f322fba75c8ca3dd4296a11bda688d63b2a547d2.tar.gz
newspipe-f322fba75c8ca3dd4296a11bda688d63b2a547d2.tar.bz2
newspipe-f322fba75c8ca3dd4296a11bda688d63b2a547d2.zip
Added a new Jinja filter to get month name from number.
Diffstat (limited to 'runserver.py')
-rwxr-xr-xrunserver.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/runserver.py b/runserver.py
index 2ced409f..156ae320 100755
--- a/runserver.py
+++ b/runserver.py
@@ -18,7 +18,7 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
+import calendar
from bootstrap import conf, application, db, populate_g
from flask.ext.babel import Babel
from flask.ext.babel import format_datetime
@@ -38,8 +38,14 @@ def allowed_file(filename):
babel = Babel(application)
+# Jinja filters
application.jinja_env.filters['datetime'] = format_datetime
+#@register.filter
+def month_name(month_number):
+ return calendar.month_name[month_number]
+application.jinja_env.filters['month_name'] = month_name
+
# Views
from flask.ext.restful import Api
from flask import g
bgstack15