Commit graph

357 commits

Author SHA1 Message Date
Armin Ronacher
086348e2f2 Added after_this_request decorator. 2012-05-08 13:14:32 +01:00
Armin Ronacher
dbfd406a21 Added required_methods 2012-05-08 12:51:26 +01:00
Armin Ronacher
2053d04db0 Improved interface for the URL build error handler 2012-05-08 11:56:11 +01:00
Ron DuPlain
e78e2a1641 Document example request_globals_class use cases. 2012-04-24 02:10:16 -04:00
Ron DuPlain
33bae1a8dc Add Flask.request_globals_class to customize g.
Requested by toothr on #pocoo.
2012-04-24 02:00:47 -04:00
Ron DuPlain
26da6a5365 Use default send_file max-age consistently.
Prior to this commit, the send_file max-age hook and config were only
used for the static file handler. Now they are used when calling
helpers.send_file directly.
2012-04-24 01:48:05 -04:00
Ron DuPlain
2262ce4915 Skip template leak test when not CPython2.7, #452. 2012-04-23 21:36:28 -04:00
Ron DuPlain
148c50abf9 Document url_for BuildError hook. 2012-04-23 21:20:47 -04:00
Ron DuPlain
8c8c524ddb Re-raise BuildError with traceback. 2012-04-22 12:51:31 -04:00
Ron DuPlain
bb31188ec3 Add a BuildError hook to url_for, #456. 2012-04-22 12:30:15 -04:00
Ron DuPlain
d90f0afe39 Add test for jsonify padded=False, #495. 2012-04-21 18:40:02 -04:00
Ron DuPlain
a3cb2a3382 Use American English for "behavior" in docs.
Prompted by plaes on #pocoo, mitsuhiko confirmed to use American English.
2012-04-19 11:51:38 -04:00
Sean Vieira
9d09632dbf Fix spelling. 2012-04-09 17:17:52 -03:00
Armin Ronacher
bcd00e5070 Fixed a typo 2012-04-09 17:56:37 +01:00
Armin Ronacher
d26af4fd6d Fixed some smaller things in the docs 2012-04-09 17:38:08 +01:00
Armin Ronacher
cb54c462b8 Pass exc explicitly to the inner context. 2012-04-09 17:32:37 +01:00
Armin Ronacher
9bed20c07c Added documentation for appcontext and teardown handlers 2012-04-09 17:29:00 +01:00
Armin Ronacher
34bbd3100b Fixed a failing testcase 2012-04-09 16:11:35 +01:00
Armin Ronacher
cf1641e5be Changed the implementation of returning tuples from functions 2012-04-09 15:56:33 +01:00
Armin Ronacher
3249eeb438 Merge branch 'master' of github.com:mitsuhiko/flask 2012-04-09 15:26:09 +01:00
Armin Ronacher
0207e90155 Updated docs for the app context. 2012-04-09 15:22:36 +01:00
Armin Ronacher
f8f2e2dff4 Added more tests for the new stack behavior. 2012-04-09 15:16:09 +01:00
Armin Ronacher
307d1bc4e5 Added support for basic URL generation without request contexts. 2012-04-09 15:04:35 +01:00
Armin Ronacher
47288231fe Implemented a separate application context. 2012-04-09 14:34:12 +01:00
Armin Ronacher
a1305973bf Fixed a typo in a comment 2012-04-09 14:19:13 +01:00
jfinkels
91efb90fb3 Removed extra blank line to fix ReST formatted documentation string in wrappers.py. Should have gone with pull request #439. 2012-04-01 13:03:22 -03:00
Ron DuPlain
f43003967e Merge pull request #439 from aisipos/jsonexceptions
Add new exceptions module, to implement JSONHttpException and JSONBadRequest.
2012-04-01 08:42:39 -07:00
Ron DuPlain
0eb75b317b Add notes on mutable values & sessions.
Using notes in 8445f0d939
2012-04-01 11:33:42 -04:00
Ron DuPlain
71a9766266 Merge pull request #417 from tarruda/master
Fixed assumption made on session implementations
2012-04-01 08:23:26 -07:00
Jon Parise
bb99158c87 Remove an unused iteration variable.
We can just iterate over the namespace dictionary's keys here.  We
don't need its values.
2012-03-19 22:33:43 -07:00
Ron DuPlain
eac350d1e6 Merge remote branch 'njl/master'
Conflicts:
	docs/quickstart.rst
2012-03-13 19:27:24 -07:00
Ron DuPlain
d94efc6db6 Expose send_file max-age as config value, #433.
Need to add the same hook in a Blueprint, but this is the first such
case where we need app.config in the Blueprint.
2012-03-13 16:34:16 -07:00
Ron DuPlain
146088d580 Expand docs on send_file option hook, #433. 2012-03-13 14:37:48 -07:00
Ron DuPlain
f4a31db9f6 Merge pull request #433 from dave-shawley/master
Introduced a method to adjust static file cache-control headers based on filename
2012-03-13 13:59:31 -07:00
Anton I. Sipos
71b351173b Move JSONHTTPException and JSONBadRequest to new module flask.exceptions. 2012-03-12 14:53:24 -07:00
Ned Jackson Lovely
68f93634de Second thoughts on mime type
After further review, changing the mime type on jsonp
responses from text/javascript to application/javascript,
with a hat-tip to
http://stackoverflow.com/questions/111302/best-content-type-to-serve-jsonp
2012-03-12 17:18:27 -04:00
Ned Jackson Lovely
09370c3f1c Clean up docs and review pull request #384
Spelunking through the issues at the PyCon sprints.
2012-03-12 15:26:05 -04:00
Christoph Heer
cb24646948 Add jsonp support inside of jsonify 2012-03-12 14:27:35 -04:00
Dave Shawley
06b224676d Added _PackageBoundObject.get_static_file_options.
This method receives the name of a static file that is going to be served
up and generates a dict of options to use when serving the file.  The
default set is empty so code will fall back to the existing behavior if
the method is not overridden.

I needed this method to adjust the cache control headers for .js files that
one of my applications was statically serving.  The default expiration is
buried in an argument to send_file and is set to 12 hours.  There was no
good way to adjust this value previously.
2012-03-12 11:19:17 -04:00
James Saryerwinnie
075b6b11c8 Fix issue 140
This allows for a view function to return something like:

    jsonify(error="error msg"), 400
2012-03-11 20:45:58 -07:00
Jeffrey Finkelstein
9711fd4020 On JSON requests, the JSON response should have Content-Type: application/json and the body of the response should be a JSON object. 2012-03-08 16:41:39 -05:00
Thiago de Arruda
8445f0d939 Fixed assumption made on session implementations.
In the snippet 'session.setdefault(...).append(...)', it was being
assumed that changes made to mutable structures in the session are
are always in sync with the session object, which is not true for
session implementations that use a external storage for keeping their
keys/values.
2012-03-02 07:46:39 -03:00
Dave Shawley
8d7ca29a35 Cleaned up test case for issue #414. 2012-03-01 08:53:58 -05:00
Dave Shawley
76773e1d0a Fixed silent keyword arg to config.from_envvar.
The ``silent`` keyword argument to Config.from_envvar was not being honored
if the environment variable existed but the file that it mentioned did not.
The fix was simple - pass the keyword argument on to the underlying call to
``from_pyfile``.  I also noticed that the return value from ``from_pyfile``
was not being passed back so I fixed that as well.
2012-03-01 08:34:08 -05:00
Dmitry Shevchenko
0b3369355d Allow loading template from iterable 2012-02-24 00:46:20 -06:00
FND
4aebc267bc Hyphenate "class-based"
makes it more readable
2012-01-31 13:54:52 +01:00
Jeffrey Finkelstein
c5ebf9a97d Added PATCH method to the list of HTTP method functions for use in the flask.views.MethodView class. 2012-01-24 16:48:04 -05:00
FND
2792dcf23e simplified as_view documentation
in the process, rewrapped lines to 78 chars (the file's current maximum)
2012-01-23 20:27:47 +01:00
FND
76c1a1f722 fixed spelling of "instantiate"
while the interwebs suggest "instanciate" might be a valid spelling, it
seems quite uncommon and potentially irritating (to pedants like myself)
2012-01-23 20:12:57 +01:00
Ron DuPlain
b786eac557 Add test for limited imp loaders, #380. 2012-01-18 18:57:05 -05:00