This parameter controls the average number of object locks allocated for each transaction; individual transactions can lock more objects as long as the locks of all transactions fit in the lock table. This is not the number of rows that can be locked; that value is unlimited. The default, 64, has historically proven sufficient, but you might need to raise this value if you have queries that touch many different tables in a single transaction, e.g. query of a parent table with many children.
class CashPaymentAdmin(admin.ModelAdmin):
readonly_fields = ('total',)
WITH RECURSIVE tree_depth as (
SELECT id, array[id] AS parents, 0 AS level
FROM Keyword
UNION ALL
SELECT C.id, P.parents || C.id, P.level + 1 as level FROM Keyword C
JOIN tree_depth P ON P.id = C.parent_id
)
Select parents[1], COUNT(*) from tree_depth group by parents[1] order by parents[1];
>>> def name():
... pass
...
>>> dir(name)
['__call__', ...
>>> class Name(object):
... def __call__(self, first, second):
... return first + second
...
>>> f = Name()
>>> f(1,2)
3
>>>
strace
и любуемся: .local/share/TelegramDesktop
/* хром, сафари */
.element::-webkit-scrollbar { width: 0; }
/* ie 10+ */
.element { -ms-overflow-style: none; }
/* фф (свойство больше не работает, других способов тоже нет)*/
.element { overflow: -moz-scrollbars-none; }
from flask import Flask, render_template as render
from index import IndexView
from user import UserView
from admin import AdminView
app = Flask(__name__)
IndexView.register(app)
UserView.register(app)
AdminView.register(app)
if __name__ == '__main__':
app.run(debug=True)
class IndexView(FlaskView):
route_base = '/' # кажется, для IndexView по умолчанию / ... но не уверен.
@route('/')
def index(self):
return render(...)
@route('/login')
def login(self):
return render(...)
@route('/logout')
def logout(self):
return render(...)
class UserView(FlaskView):
# route_base = '/user' # необязательно
@route('/')
def index(self):
return render(...)
@route('/<int:id>')
def get_user(self, id):
return render(...)
.filter('nl2br', ['$sce', function ($sce) {
return function (text) {
return text ? $sce.trustAsHtml(text.replace('<', '«').replace('>', '»').replace(/\n/g, '<br/>')) : '';
};
}]);
<div ng-bind-html="text | nl2br"></div>