- Create filters.py
- Use nl2br filter in your Jinja template
{{ text|nl2br }}
package your.package.name; | |
import android.util.Log; | |
/* | |
* Copyright (C) 2014 Matej Ramuta | |
* | |
* Logga - the most gangsta Android logger :) | |
* | |
* For more info and instructions see a README here: https://github.com/ramuta/logga/blob/master/README.md |
In FragmentActivity set ViewPager as public static: | |
public static ViewPager viewPager; | |
Now you can access it from every child Fragment: | |
MainActivity.viewPager.setCurrentItem(6); |
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title>SmartNinja basic Jinja template</title> | |
<link rel="stylesheet" href="/assets/css/style.css"> | |
</head> | |
<body> | |
<h1>Hello, SmartNinja!</h1> |
[{"id":1,"first_name":"Nicholas","last_name":"Weaver","email":"[email protected]","country":"Russia","SSN":"283-85-6882"}, | |
{"id":2,"first_name":"Gary","last_name":"Bowman","email":"[email protected]","country":"Argentina","SSN":"720-12-3501"}, | |
{"id":3,"first_name":"Carol","last_name":"Sanders","email":"[email protected]","country":"Indonesia","SSN":"217-56-6996"}, | |
{"id":4,"first_name":"Lois","last_name":"Brooks","email":"[email protected]","country":"Serbia","SSN":"381-92-1870"}, | |
{"id":5,"first_name":"Kenneth","last_name":"Ellis","email":"[email protected]","country":"China","SSN":"452-63-1019"}, | |
{"id":6,"first_name":"Jason","last_name":"Long","email":"[email protected]","country":"Russia","SSN":"472-51-3627"}, | |
{"id":7,"first_name":"Arthur","last_name":"Johnson","email":"[email protected]","country":"Zimbabwe","SSN":"104-46-5565"}, | |
{"id":8,"first_name":"James","last_name":"Owens","email":"[email protected]","country":"China","SSN":"469-62-2575"}, | |
{"id":9,"first_name":"Julia","last_name" |
Narobe: | |
<head> | |
<meta charset="UTF-8"> | |
</head> | |
Pravilno: | |
<head> |
package com.example.nino.financeappv20; | |
import android.content.Context; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.BaseAdapter; | |
import android.widget.TextView; | |
import com.example.nino.financeappv20.model.FinanceData; |
from google.appengine.api import users | |
from webapp2 import redirect_to, redirect | |
def admin_required(handler): | |
def _check_login(self, *args, **kwargs): | |
user = users.get_current_user() | |
if user: | |
if not users.is_current_user_admin(): | |
return redirect_to("forbidden") | |
else: |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="keywords" content="avto, renault, audi"> | |
<meta name="author" content="Matej Ramuta"> | |
<meta name="description" content="Moja stran o avtih"> | |
<title>moja super spletna stran</title> | |
<meta charset="UTF-8"> | |
</head> | |