Commits

Anonymous committed b4d5c7c Merge

Merging last changes from me for 2.1b1.

  • Participants
  • Parent commits de45477, 8934deb
  • Tags 2.1b1

Comments (0)

Files changed (4)

File docs/index.rst

 The TurboGears stack is made up of a four main components that aim at increasing
 web development productivity.  Each of these components can in fact be used
 independently, or within other applications, so the knowledge you gain
-by learning about this components is highly applicable to other projects
+by learning about these components is highly applicable to other projects
 you might do, including those outside the scope of web design.  Here is a breakdown
 of what you can expect to see in the stack.
 
 
 Genshi_ was popularized by the project tracking software called Trac.  Genshi
 provides an easy way to create templated content by providing developers
-with pythonic tools, (x)html validation, and useful debugging messages.  Kid
-Developers coming over from TurboGears 1.1 will feel at home with the familiar
+with pythonic tools, (x)html validation, and useful debugging messages.  Kid_
+developers coming over from TurboGears 1.1 will feel at home with the familiar
 syntax.
 
+.. _Kid: http://www.kid-templating.org/
+
 Pylons_ is our web server of choice.  Pylons is a good choice for our web server,
 because it embraces WSGI, and is also broken into smaller swappable components.  Pylons
 gives us routing, caching, sessions, and a set of thread-safe globals to make

File docs/main/Config.rst

 complex python objects without adding a dependency on ConfigObj (which
 was used in TG1).
 
-One disadvantage of the new configuration system is that it does 
+One disadvantage of the new configuration system is that it does
 not evaluate values in
 the .ini files therefore all values are considered strings. This is
 especially important when using boolean attributes and numbers as you
 A TurboGears quickstarted project will contain a couple of .ini files
 which are used to define what WSGI app ought to be run, and to store
 end-user created configuration values, which is just another way of
-saying that the .ini files should contain *deployment specific* 
+saying that the .ini files should contain *deployment specific*
 options.
 
 By default TurboGears provides a ``development.ini``, ``test.ini``,
 
    from paste.deploy.converters import asbool
    if asbool(config['enable_subsystem']):
-      ... sub systems is enabled... 
+      ... sub systems is enabled...
 
 The config module
 -----------------
 Mimetypes
 +++++++++++++
 
-By default, only json/application and text/html are defined mimetypes. 
-If you would like to use additional mime-types you must register 
-them with your application's config. You can accomplish this by 
+By default, only json/application and text/html are defined mimetypes.
+If you would like to use additional mime-types you must register
+them with your application's config. You can accomplish this by
 adding the following code your your app_cfg.py file::
 
     base_config.mimetype_lookup = {'.ext':'my-mimetype'}
 TurboGears allows you to attach callables both to the startup of the
 server, and the shut down.  The startup is called before the environment
 is loaded, and the shutdown code runs when the python process shuts down.
-Heres an example of "hello, world" using startup and shutdown in your 
+Heres an example of "hello, world" using startup and shutdown in your
 app_cfg.py file::
 
     def on_startup():
         print 'hello, startup world'
-        
+
     def on_shutdown():
         print 'hello, shutdown world'
-    
+
     # ... (base_config init code)
-    
+
     base_config.call_on_startup = [on_startup]
     base_config.call_on_shutdown = [on_shutdown]
 
 Set to False if you have set up apache, or nginx (or some other
 server) to handles static files.
 
+Request Extensions
++++++++++++++++++++++++
+
+``base_config.disable_request_extensions`` -- by default this is false.
+This means that TG will take the request, and strip anything off the end
+of the last element in the URL that follows ".".  It will then take this
+information, and assign an appropriate mime-type and store the data in the
+tg.request.response_type and tg.request.response_ext variables.  By enabling
+this flag, you disable this behavior, rendering TG unable to determine the
+mime-type that the user is requesting automatically.
+
+
 Stand Alone
 +++++++++++++++
 
 
         def add_tosca2_middleware(self, app):
 
-            app = TwMiddleware(app, 
+            app = TwMiddleware(app,
                 default_engine=self.default_renderer,
                 translator=ugettext,
                 auto_reload_templates = False
                 )
-            
+
             return app
     base_config = MyAppConfig()
-    
+
     # modify base_config parameters below
-    
+
 The above example shows how one would go about overridding the toscawidgets2
-middleware.  See the class definition below for more ideas on how you 
+middleware.  See the class definition below for more ideas on how you
 could modify your own custom config
 
 AppConfig General Options
 
 .. autoclass:: AppConfig
    :members: init_config,
-             add_core_middleware, 
+             add_core_middleware,
              add_error_middleware,
              setup_tg_wsgi_app,
              setup_helpers_and_globals,
              make_load_environment
-             
+
 
 More Configuration Options
 ------------------------------
 These configuration options have been broken into sub pages for easier digestion.
 
-             
+
 .. toctree::
    :maxdepth: 1
 

File docs/main/Pagination/index.rst

 
 :Status: Work in progress
 
+.. todo:: Needs to mention the paginate decorator.
+
 Prerequisites
 -------------
 
 	                  ["Night on Earth", 1991],
 	                  ["Genova", 2008],
 	                  ["Snatch", 2000]]
-	    
+
 	    movies = []
 	    for data in movieDatas:
 	        movie = Movie()
 	        movie.title = data[0]
 	        movie.year = data[1]
 	        model.DBSession.add(movie)
-  
+
 
 After you set up your application and restart the server you should now have
 seven movies listed.
 
 	paster setup-app development.ini
 	paster serve --reload development.ini
-	 
-    
+
+
 
 Basic Pagination
 ----------------
 ``list()`` method to look like this::
 
 	    from webhelpers import paginate
-		
+
 	    @expose("toscasample.templates.movie_list")
 	    def list(self, page=1):
 	        """List and paginate all movies in the database"""
 Template code in ``templates/movie_list.html``::
 
 	<p class="pagelist">${currentPage.pager()}</p>
-	
+
 .. highlight:: python
 
 
 
 Create a file pagination.css in your public/css/ directory with the
 following contents and include it in style.css:
- 
+
 .. highlight:: css
 
 CSS in ``public/css/style.css``::
 
-	@import url("pagination.css"); 
+	@import url("pagination.css");
 
 CSS in ``public/css/pagination.css``::
 
 	.pagelist strong {
 		padding: 5px;
 	}
-	
+
 	p.pagelist {
 		text-align: center;
 	}
-	
+
 Your movie listing should now look something like this:
 
-.. image:: tg2pagination_fig1.png		
+.. image:: tg2pagination_fig1.png
 
-		
+
 
 Advanced Pagination
 -------------------
 
 	${currentPage.pager(format='~3~', page_param='page', show_if_single_page=True)}
 
-	
+
 See
 http://www.pylonshq.com/docs/en/0.9.7/thirdparty/webhelpers/paginate/
 for more details.
 		${currentPage.pager(format='~3~', page_param='page', show_if_single_page=True)}
 		<a class="nextPage" href="/list?page=${currentPage.next_page}">&gt;&gt;&gt;</a>
 	</p>
-	
+
 Functional, but not very pretty:
 
-.. image:: tg2pagination_fig2.png		
+.. image:: tg2pagination_fig2.png
 
 
 
 
  .. image:: icons/arrow-right.png
    :height: 32
-   
+
 
 .. note ::
 
 		${currentPage.pager(format='~3~', page_param='page', show_if_single_page=True)}
 		<a class="nextPage" href="/list?page=${currentPage.next_page}">&nbsp;</a>
 	</p>
-	
+
 .. highlight:: css
 
 Add this to the CSS in ``public/css/pagination.css``::
 		padding-bottom: 15px;
 		text-decoration: none;
 		}
-	
+
 	.nextPage {
 		background: url("/images/icons/png/32x32/arrow-right.png") no-repeat;
 		padding-left: 18px;
 		padding-top: 12px;
 		padding-bottom: 15px;
 		text-decoration: none;
-		}		
+		}
 
 And this is what the end result looks like:
 
-.. image:: tg2pagination_fig3.png		
+.. image:: tg2pagination_fig3.png
 
 An :download:`Example Project <ToscaWidgetsFormsPaginated.zip>` has
 been attached so that you can try this easily.

File docs/recipesandfaq.rst

 
 .. todo:: Difficulty: Easy. Validate that toctree maxdepth values are appropriate
 
+.. todo:: Difficulty: Easy. Explain usage of tgscheduler and how to use SQLAlchemy in a task
+
 Next Steps
 ----------