fixed cache expiration in grid downloads, thanks Niphlod

This commit is contained in:
mdipierro committed 2013-02-04 15:12:15 -06:00
1 parent 8f76efeb2f
commit 9069f06857
4 files changed
+23 -23

No files matched your search

+1 -1
View File
@@ -1 +1 @@
Version 2.4.1-alpha.2+timestamp.2013.02.04.10.02.48 Version 2.4.1-alpha.2+timestamp.2013.02.04.15.11.29
+16 -16
View File
@@ -876,7 +876,7 @@ class BaseAdapter(ConnectionPool):
# The reason is that we do not want to trigger # The reason is that we do not want to trigger
# a migration simply because a default value changes. # a migration simply because a default value changes.
not_null = self.NOT_NULL(field.default, field_type) not_null = self.NOT_NULL(field.default, field_type)
ftype = ftype.replace('NOT NULL', not_null) ftype = ftype.replace('NOT NULL', not_null)
sql_fields_aux[field_name] = dict(sql=ftype) sql_fields_aux[field_name] = dict(sql=ftype)
# Postgres - PostGIS: # Postgres - PostGIS:
# geometry fields are added after the table has been created, not now # geometry fields are added after the table has been created, not now
@@ -1234,7 +1234,7 @@ class BaseAdapter(ConnectionPool):
self.expand('%'+second, 'string')) self.expand('%'+second, 'string'))
def CONTAINS(self, first, second, case_sensitive=False): def CONTAINS(self, first, second, case_sensitive=False):
if isinstance(second,Expression): if isinstance(second,Expression):
field = self.expand(first) field = self.expand(first)
expr = self.expand(second,'string') expr = self.expand(second,'string')
if first.type.startswith('list:'): if first.type.startswith('list:'):
@@ -3265,7 +3265,7 @@ class MSSQL2Adapter(MSSQLAdapter):
def execute(self,a): def execute(self,a):
return self.log_execute(a.decode('utf8')) return self.log_execute(a.decode('utf8'))
class SybaseAdapter(MSSQLAdapter): class SybaseAdapter(MSSQLAdapter):
drivers = ('Sybase',) drivers = ('Sybase',)
@@ -5037,7 +5037,7 @@ class MongoDBAdapter(NoSQLAdapter):
'list:reference': list, 'list:reference': list,
} }
error_messages = {"javascript_needed": "This must yet be replaced" + error_messages = {"javascript_needed": "This must yet be replaced" +
" with javascript in order to work."} " with javascript in order to work."}
def __init__(self,db,uri='mongodb://127.0.0.1:5984/db', def __init__(self,db,uri='mongodb://127.0.0.1:5984/db',
@@ -5116,12 +5116,12 @@ class MongoDBAdapter(NoSQLAdapter):
raise ValueError( raise ValueError(
"invalid objectid argument string: %s" % e) "invalid objectid argument string: %s" % e)
else: else:
raise ValueError("Invalid objectid argument string. " + raise ValueError("Invalid objectid argument string. " +
"Requires an integer or base 16 value") "Requires an integer or base 16 value")
elif isinstance(arg, self.ObjectId): elif isinstance(arg, self.ObjectId):
return arg return arg
if not isinstance(arg, (int, long)): if not isinstance(arg, (int, long)):
raise TypeError("object_id argument must be of type " + raise TypeError("object_id argument must be of type " +
"ObjectId or an objectid representable integer") "ObjectId or an objectid representable integer")
if arg == 0: if arg == 0:
hexvalue = "".zfill(24) hexvalue = "".zfill(24)
@@ -5153,7 +5153,7 @@ class MongoDBAdapter(NoSQLAdapter):
return value return value
return value return value
# Safe determines whether a asynchronious request is done or a # Safe determines whether a asynchronious request is done or a
# synchronious action is done # synchronious action is done
# For safety, we use by default synchronious requests # For safety, we use by default synchronious requests
def insert(self, table, fields, safe=None): def insert(self, table, fields, safe=None):
@@ -5273,7 +5273,7 @@ class MongoDBAdapter(NoSQLAdapter):
elif len(fields) != 0: elif len(fields) != 0:
tablename = fields[0].tablename tablename = fields[0].tablename
else: else:
raise SyntaxError("The table name could not be found in " + raise SyntaxError("The table name could not be found in " +
"the query nor from the select statement.") "the query nor from the select statement.")
mongoqry_dict = self.expand(query) mongoqry_dict = self.expand(query)
@@ -5299,7 +5299,7 @@ class MongoDBAdapter(NoSQLAdapter):
sort=mongosort_list, snapshot=snapshot).count()} sort=mongosort_list, snapshot=snapshot).count()}
else: else:
# pymongo cursor object # pymongo cursor object
mongo_list_dicts = ctable.find(mongoqry_dict, mongo_list_dicts = ctable.find(mongoqry_dict,
mongofields_dict, skip=limitby_skip, mongofields_dict, skip=limitby_skip,
limit=limitby_limit, sort=mongosort_list, limit=limitby_limit, sort=mongosort_list,
snapshot=snapshot) snapshot=snapshot)
@@ -5396,7 +5396,7 @@ class MongoDBAdapter(NoSQLAdapter):
if safe is None: if safe is None:
safe = self.safe safe = self.safe
amount = 0 amount = 0
amount = self.count(query, False) amount = self.count(query, False)
if not isinstance(query, Query): if not isinstance(query, Query):
raise RuntimeError("query type %s is not supported" % \ raise RuntimeError("query type %s is not supported" % \
type(query)) type(query))
@@ -5695,7 +5695,7 @@ class IMAPAdapter(NoSQLAdapter):
# This avoids the extra server names retrieval # This avoids the extra server names retrieval
imapdb.define_tables({"inbox": "INBOX"}) imapdb.define_tables({"inbox": "INBOX"})
# Selects without content/attachments/email columns will only # Selects without content/attachments/email columns will only
# fetch header and flags # fetch header and flags
@@ -6088,7 +6088,7 @@ class IMAPAdapter(NoSQLAdapter):
# keep the requests small for header/flags # keep the requests small for header/flags
if any([(field.name in ["content", "size", if any([(field.name in ["content", "size",
"attachments", "email"]) for "attachments", "email"]) for
field in fields]): field in fields]):
imap_fields = "(RFC822 FLAGS)" imap_fields = "(RFC822 FLAGS)"
else: else:
@@ -7293,14 +7293,14 @@ def index():
"/{person.name}/pets[pet.ownedby]/{pet.name}", "/{person.name}/pets[pet.ownedby]/{pet.name}",
"/{person.name}/pets[pet.ownedby]/{pet.name}/:field", "/{person.name}/pets[pet.ownedby]/{pet.name}/:field",
("/dogs[pet]", db.pet.info=='dog'), ("/dogs[pet]", db.pet.info=='dog'),
("/dogs[pet]/{pet.name.startswith}", db.pet.info=='dog'), ("/dogs[pet]/{pet.name.startswith}", db.pet.info=='dog'),
] ]
parser = db.parse_as_rest(patterns,args,vars) parser = db.parse_as_rest(patterns,args,vars)
if parser.status == 200: if parser.status == 200:
return dict(content=parser.response) return dict(content=parser.response)
else: else:
raise HTTP(parser.status,parser.error) raise HTTP(parser.status,parser.error)
def POST(table_name,**vars): def POST(table_name,**vars):
if table_name == 'person': if table_name == 'person':
return db.person.validate_and_insert(**vars) return db.person.validate_and_insert(**vars)
@@ -8797,7 +8797,7 @@ class Expression(object):
return Expression(db, db._adapter.AS, self, alias, self.type) return Expression(db, db._adapter.AS, self, alias, self.type)
# GIS expressions # GIS expressions
def st_asgeojson(self, precision=15, options=0, version=1): def st_asgeojson(self, precision=15, options=0, version=1):
return Expression(self.db, self.db._adapter.ST_ASGEOJSON, self, return Expression(self.db, self.db._adapter.ST_ASGEOJSON, self,
dict(precision=precision, options=options, dict(precision=precision, options=options,
@@ -9131,7 +9131,7 @@ class Field(Expression):
stream = self.uploadfs.open(name, 'rb') stream = self.uploadfs.open(name, 'rb')
else: else:
# ## if file is on regular filesystem # ## if file is on regular filesystem
stream = open(pjoin(file_properties['path'], name), 'rb') stream = pjoin(file_properties['path'], name)
return (filename, stream) return (filename, stream)
def retrieve_file_properties(self, name, path=None): def retrieve_file_properties(self, name, path=None):
+4 -4
View File
@@ -308,8 +308,8 @@ class Response(Storage):
chunk_size=DEFAULT_CHUNK_SIZE, chunk_size=DEFAULT_CHUNK_SIZE,
request=None, request=None,
attachment=False, attachment=False,
filename=None, filename=None
): ):
""" """
if a controller function:: if a controller function::
@@ -403,8 +403,8 @@ class Response(Storage):
raise HTTP(404) raise HTTP(404)
headers = self.headers headers = self.headers
headers['Content-Type'] = contenttype(name) headers['Content-Type'] = contenttype(name)
if download_filename == None: if download_filename == None:
download_filename = filename download_filename = filename
if attachment: if attachment:
headers['Content-Disposition'] = \ headers['Content-Disposition'] = \
'attachment; filename="%s"' % download_filename.replace('"','\"') 'attachment; filename="%s"' % download_filename.replace('"','\"')
+2 -2
View File
@@ -46,8 +46,8 @@ def stream_file_or_304_or_206(
request=None, request=None,
headers={}, headers={},
status=200, status=200,
error_message=None, error_message=None
): ):
if error_message is None: if error_message is None:
error_message = rewrite.THREAD_LOCAL.routes.error_message % 'invalid request' error_message = rewrite.THREAD_LOCAL.routes.error_message % 'invalid request'
try: try: