fixed appadmin bug and excessive session saving
This commit is contained in:
@@ -1 +1 @@
|
||||
Version 2.1.1 (2012-10-17 12:04:15) dev
|
||||
Version 2.1.1 (2012-10-17 14:29:55) dev
|
||||
|
||||
@@ -200,13 +200,14 @@ def select():
|
||||
_class='delete', _type='checkbox', value=False), ''),
|
||||
TR('', '', INPUT(_type='submit', _value=T('submit')))),
|
||||
_action=URL(r=request,args=request.args))
|
||||
|
||||
tb = None
|
||||
if form.accepts(request.vars, formname=None):
|
||||
regex = re.compile(request.args[0] + '\.(?P<table>\w+)\..+')
|
||||
match = regex.match(form.vars.query.strip())
|
||||
if match:
|
||||
table = match.group('table')
|
||||
try:
|
||||
tb = None
|
||||
nrows = db(query).count()
|
||||
if form.vars.update_check and form.vars.update_fields:
|
||||
db(query).update(**eval_in_global_env('dict(%s)'
|
||||
|
||||
@@ -200,13 +200,14 @@ def select():
|
||||
_class='delete', _type='checkbox', value=False), ''),
|
||||
TR('', '', INPUT(_type='submit', _value=T('submit')))),
|
||||
_action=URL(r=request,args=request.args))
|
||||
|
||||
tb = None
|
||||
if form.accepts(request.vars, formname=None):
|
||||
regex = re.compile(request.args[0] + '\.(?P<table>\w+)\..+')
|
||||
match = regex.match(form.vars.query.strip())
|
||||
if match:
|
||||
table = match.group('table')
|
||||
try:
|
||||
tb = None
|
||||
nrows = db(query).count()
|
||||
if form.vars.update_check and form.vars.update_fields:
|
||||
db(query).update(**eval_in_global_env('dict(%s)'
|
||||
|
||||
@@ -200,13 +200,14 @@ def select():
|
||||
_class='delete', _type='checkbox', value=False), ''),
|
||||
TR('', '', INPUT(_type='submit', _value=T('submit')))),
|
||||
_action=URL(r=request,args=request.args))
|
||||
|
||||
tb = None
|
||||
if form.accepts(request.vars, formname=None):
|
||||
regex = re.compile(request.args[0] + '\.(?P<table>\w+)\..+')
|
||||
match = regex.match(form.vars.query.strip())
|
||||
if match:
|
||||
table = match.group('table')
|
||||
try:
|
||||
tb = None
|
||||
nrows = db(query).count()
|
||||
if form.vars.update_check and form.vars.update_fields:
|
||||
db(query).update(**eval_in_global_env('dict(%s)'
|
||||
|
||||
+5
-2
@@ -111,8 +111,10 @@ class Request(Storage):
|
||||
def user_agent(self):
|
||||
from gluon.contrib import user_agent_parser
|
||||
session = current.session
|
||||
user_agent = session._user_agent = session._user_agent or \
|
||||
user_agent = session._user_agent or \
|
||||
user_agent_parser.detect(self.env.http_user_agent)
|
||||
if session:
|
||||
session._user_agent = user_agent
|
||||
user_agent = Storage(user_agent)
|
||||
for key,value in user_agent.items():
|
||||
if isinstance(value,dict):
|
||||
@@ -666,7 +668,8 @@ class Session(Storage):
|
||||
|
||||
def _unchanged(self):
|
||||
previous_session_hash = self.pop('_session_hash',None)
|
||||
if not previous_session_hash and not self:
|
||||
if not previous_session_hash and not \
|
||||
any(value is not None for value in self.itervalues()):
|
||||
return True
|
||||
session_pickled = cPickle.dumps(dict(self))
|
||||
session_hash = hashlib.md5(session_pickled).hexdigest()
|
||||
|
||||
@@ -48,7 +48,6 @@ class Storage(dict):
|
||||
__getstate__ = lambda self: None
|
||||
__copy__ = lambda self: Storage(self)
|
||||
|
||||
|
||||
def getlist(self,key):
|
||||
"""
|
||||
Return a Storage value as a list.
|
||||
|
||||
Reference in New Issue
Block a user