<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Axant Tech Blog</title>
	<atom:link href="http://blog.axant.it/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.axant.it</link>
	<description>AXANT Experience Report</description>
	<pubDate>Tue, 31 Jan 2012 20:22:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Mastering the TurboGears EasyCrudRestController</title>
		<link>http://blog.axant.it/archives/423</link>
		<comments>http://blog.axant.it/archives/423#comments</comments>
		<pubDate>Tue, 31 Jan 2012 20:22:06 +0000</pubDate>
		<dc:creator>amol</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[turbogears]]></category>

		<guid isPermaLink="false">http://blog.axant.it/?p=423</guid>
		<description><![CDATA[One of the key features of TurboGears2 is the great CRUD extension. Mastering the CRUD extension can really make the difference between spending hours or just a few minutes on writing a web app prototype or even a full application.
The CRUD extension provides two main features, the CrudRestController which is meant to help creating totally [...]]]></description>
			<content:encoded><![CDATA[<p>One of the key features of <a href="http://www.turbogears.org">TurboGears2</a> is the great <a href="http://pypi.python.org/pypi/tgext.crud">CRUD extension</a>. Mastering the CRUD extension can really make the difference between spending hours or just a few minutes on writing a web app prototype or even a full application.</p>
<p>The CRUD extension provides two main features, the <a href="http://www.turbogears.org/2.1/docs/main/Extensions/Crud/index.html#creating-our-own-crudrestcontroller">CrudRestController</a> which is meant to help creating totally custom CRUDs and the <a href="http://www.turbogears.org/2.1/docs/main/Extensions/Crud/index.html#easycrudrestcontroller">EasyCrudRestController</a> which provides a quick and easy way to create CRUD interfaces.</p>
<p>I&#8217;ll focus on the EasyCrudRestController as it is the easiest and more productive one, moving forward to the CrudRestController is quite straightforward after you feel confident with the Easy one.</p>
<p>The target will be to create, in no more than 40 lines of controller code, a full featured photo gallery application with:</p>
<ul>
<li>Multiple Albums</li>
<li>Uploads with Thumbnails Generation</li>
<li>Authenticated Access, only users in group &#8220;photos&#8221; will be able to manage photos</li>
<li>Contextual Management, manage photos of one album at time instead of having all photos mixed together in a generic management section</li>
</ul>
<p><a href="http://blog.axant.it/wp-content/uploads/2012/01/photos.png"><img class="alignnone size-full wp-image-426" src="http://blog.axant.it/wp-content/uploads/2012/01/photos.png" alt="" width="500" height="320" /></a></p>
<p>If you don&#8217;t already know how to create a new TurboGears project, start by giving a look at <a href="http://www.turbogears.org/2.1/docs/main/DownloadInstall.html#installation-for-the-impatient">TurboGears Installation for The Impatient</a> guide. Just remember to add <code>tgext.datahelpers</code> to dependencies inside your project <code>setup.py</code> before running the <code>setup.py develop</code> command.</p>
<p>I&#8217;ll start by providing a Gallery and Photo model. To store the images I&#8217;ll use <a href="http://pypi.python.org/pypi/tgext.datahelpers">tgext.datahelpers</a> to avoid having to manage the attachments. Using datahelpers also provides the advantage of having thumbnails support for free.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> tgext.<span style="color: black;">datahelpers</span>.<span style="color: black;">fields</span> <span style="color: #ff7700;font-weight:bold;">import</span> Attachment, AttachedImage
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> Gallery<span style="color: black;">&#40;</span>DeclarativeBase<span style="color: black;">&#41;</span>:
    __tablename__ = <span style="color: #483d8b;">'galleries'</span>
&nbsp;
   uid = Column<span style="color: black;">&#40;</span>Integer, autoincrement=<span style="color: #008000;">True</span>, primary_key=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span>
   name = Column<span style="color: black;">&#40;</span>Unicode<span style="color: black;">&#40;</span><span style="color: #ff4500;">100</span><span style="color: black;">&#41;</span>, nullable=<span style="color: #008000;">False</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> Photo<span style="color: black;">&#40;</span>DeclarativeBase<span style="color: black;">&#41;</span>:
    __tablename__ = <span style="color: #483d8b;">'photos'</span>
&nbsp;
    uid = Column<span style="color: black;">&#40;</span>Integer, autoincrement=<span style="color: #008000;">True</span>, primary_key=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span>
    name = Column<span style="color: black;">&#40;</span>Unicode<span style="color: black;">&#40;</span><span style="color: #ff4500;">100</span><span style="color: black;">&#41;</span>, nullable=<span style="color: #008000;">False</span><span style="color: black;">&#41;</span>
    description = Column<span style="color: black;">&#40;</span>Unicode<span style="color: black;">&#40;</span><span style="color: #ff4500;">2048</span><span style="color: black;">&#41;</span>, nullable=<span style="color: #008000;">False</span><span style="color: black;">&#41;</span>
    image = Column<span style="color: black;">&#40;</span>Attachment<span style="color: black;">&#40;</span>AttachedImage<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
    author_id = Column<span style="color: black;">&#40;</span>Integer, ForeignKey<span style="color: black;">&#40;</span>model.<span style="color: black;">User</span>.<span style="color: black;">user_id</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    author = relation<span style="color: black;">&#40;</span>app_model.<span style="color: black;">User</span>, backref=backref<span style="color: black;">&#40;</span><span style="color: #483d8b;">'photos'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
    gallery_id = Column<span style="color: black;">&#40;</span>Integer, ForeignKey<span style="color: black;">&#40;</span>Gallery.<span style="color: black;">uid</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    gallery = relation<span style="color: black;">&#40;</span>Gallery, backref=backref<span style="color: black;">&#40;</span><span style="color: #483d8b;">'photos'</span>, cascade=<span style="color: #483d8b;">'all, delete-orphan'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Now to be able to start using our galleries we will have to provide a place where to view them and a gallery management controller to create and manage them. Viewing them should be quite straightforward, I&#8217;ll just retrieve the galleries from the database inside my <code>index</code> method and render them. To access a single gallery I&#8217;ll rely on the datahelpers <code>SQLAEntityConverter</code> which will retrieve the gallery for us ensuring it exists and is valid. For the management part I&#8217;ll create an <code>EasyCrudRestController</code> mounted as <code>/manage_galleries</code></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> tgext.<span style="color: black;">crud</span> <span style="color: #ff7700;font-weight:bold;">import</span> EasyCrudRestController
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> GalleriesController<span style="color: black;">&#40;</span>EasyCrudRestController<span style="color: black;">&#41;</span>:
    allow_only = predicates.<span style="color: black;">in_group</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'photos'</span><span style="color: black;">&#41;</span>
    title = <span style="color: #483d8b;">&quot;Manage Galleries&quot;</span>
    model = model.<span style="color: black;">Gallery</span>
&nbsp;
    __form_options__ = <span style="color: black;">&#123;</span>
        <span style="color: #483d8b;">'__hide_fields__'</span> : <span style="color: black;">&#91;</span><span style="color: #483d8b;">'uid'</span><span style="color: black;">&#93;</span>,
        <span style="color: #483d8b;">'__omit_fields__'</span> : <span style="color: black;">&#91;</span><span style="color: #483d8b;">'photos'</span><span style="color: black;">&#93;</span>
    <span style="color: black;">&#125;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> RootController<span style="color: black;">&#40;</span>BaseController<span style="color: black;">&#41;</span>:
    manage_galleries = GalleriesController<span style="color: black;">&#40;</span>DBSession<span style="color: black;">&#41;</span>
&nbsp;
    @expose<span style="color: black;">&#40;</span><span style="color: #483d8b;">'photos.templates.index'</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> index<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, <span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kw<span style="color: black;">&#41;</span>:
        galleries = DBSession.<span style="color: black;">query</span><span style="color: black;">&#40;</span>Gallery<span style="color: black;">&#41;</span>.<span style="color: black;">order_by</span><span style="color: black;">&#40;</span>Gallery.<span style="color: black;">uid</span>.<span style="color: black;">desc</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>.<span style="color: #008000;">all</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">dict</span><span style="color: black;">&#40;</span>galleries=galleries<span style="color: black;">&#41;</span>
&nbsp;
    @expose<span style="color: black;">&#40;</span><span style="color: #483d8b;">'photos.templates.gallery'</span><span style="color: black;">&#41;</span>
    @validate<span style="color: black;">&#40;</span><span style="color: #008000;">dict</span><span style="color: black;">&#40;</span>gallery=SQLAEntityConverter<span style="color: black;">&#40;</span>Gallery<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>, error_handler=index<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> gallery<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, gallery<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">dict</span><span style="color: black;">&#40;</span>gallery=gallery<span style="color: black;">&#41;</span></pre></div></div>

<p>Logging in with an user inside the <code>photos</code> group and accessing the <code>/manage_galleries</code> url we will be able to create a new gallery and manage the existing ones. </p>
<p><a href="http://blog.axant.it/wp-content/uploads/2012/01/gallerylisting.png"><img src="http://blog.axant.it/wp-content/uploads/2012/01/gallerylisting.png" alt="" width="500" height="220" class="alignnone size-full wp-image-444" /></a></p>
<p>To configure how the crud controller forms should appear and behave the <code>__form_options__</code> property of the <code>EasyCrudRestController</code> can be used. This property relies on the same options as <a href="http://packages.python.org/sprox/modules/sprox.formbase.html#module-sprox.formbase">Sprox FormBase</a> and customizes both the <strong>Edit</strong> and <strong>Add</strong> forms.<br />
The next part is probably to be able to upload some photos inside our newly created galleries. To perform this we will create a new <code>EasyCrudRestController</code> for gallery photos management.</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> tgext.<span style="color: black;">crud</span> <span style="color: #ff7700;font-weight:bold;">import</span> EasyCrudRestController
<span style="color: #ff7700;font-weight:bold;">from</span> tw.<span style="color: black;">forms</span> <span style="color: #ff7700;font-weight:bold;">import</span> FileField
<span style="color: #ff7700;font-weight:bold;">from</span> tw.<span style="color: black;">forms</span>.<span style="color: black;">validators</span> <span style="color: #ff7700;font-weight:bold;">import</span> FieldStorageUploadConverter
<span style="color: #ff7700;font-weight:bold;">from</span> webhelpers <span style="color: #ff7700;font-weight:bold;">import</span> html
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> PhotosController<span style="color: black;">&#40;</span>EasyCrudRestController<span style="color: black;">&#41;</span>:
    allow_only = predicates.<span style="color: black;">in_group</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'photos'</span><span style="color: black;">&#41;</span>
    title = <span style="color: #483d8b;">&quot;Manage Photos&quot;</span>
    model = model.<span style="color: black;">Photo</span>
    keep_params = <span style="color: black;">&#91;</span><span style="color: #483d8b;">'gallery'</span><span style="color: black;">&#93;</span>
&nbsp;
    __form_options__ = <span style="color: black;">&#123;</span>
        <span style="color: #483d8b;">'__hide_fields__'</span> : <span style="color: black;">&#91;</span><span style="color: #483d8b;">'uid'</span>, <span style="color: #483d8b;">'author'</span>, <span style="color: #483d8b;">'gallery'</span><span style="color: black;">&#93;</span>,
        <span style="color: #483d8b;">'__field_widget_types__'</span> : <span style="color: black;">&#123;</span><span style="color: #483d8b;">'image'</span>:FileField<span style="color: black;">&#125;</span>,
        <span style="color: #483d8b;">'__field_validator_types__'</span> : <span style="color: black;">&#123;</span><span style="color: #483d8b;">'image'</span>:FieldStorageUploadConverter<span style="color: black;">&#125;</span>,
        <span style="color: #483d8b;">'__field_widget_args__'</span> : <span style="color: black;">&#123;</span><span style="color: #483d8b;">'author'</span>:<span style="color: black;">&#123;</span><span style="color: #483d8b;">'default'</span>:<span style="color: #ff7700;font-weight:bold;">lambda</span>:request.<span style="color: black;">identity</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'user'</span><span style="color: black;">&#93;</span>.<span style="color: black;">user_id</span><span style="color: black;">&#125;</span><span style="color: black;">&#125;</span>
    <span style="color: black;">&#125;</span>
&nbsp;
    __table_options__ = <span style="color: black;">&#123;</span>
        <span style="color: #483d8b;">'__omit_fields__'</span> : <span style="color: black;">&#91;</span><span style="color: #483d8b;">'uid'</span>, <span style="color: #483d8b;">'author_id'</span>, <span style="color: #483d8b;">'gallery_id'</span>, <span style="color: #483d8b;">'gallery'</span><span style="color: black;">&#93;</span>,
        <span style="color: #483d8b;">'__xml_fields__'</span> : <span style="color: black;">&#91;</span><span style="color: #483d8b;">'image'</span><span style="color: black;">&#93;</span>,
        <span style="color: #483d8b;">'image'</span>: <span style="color: #ff7700;font-weight:bold;">lambda</span> filler,row: html.<span style="color: black;">literal</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'‹img src=&quot;%s&quot;/›'</span> <span style="color: #66cc66;">%</span> row.<span style="color: black;">image</span>.<span style="color: black;">thumb_url</span><span style="color: black;">&#41;</span>
    <span style="color: black;">&#125;</span></pre></div></div>

<p></code></p>
<p>Mounting this inside the RootController as <code>manage_photos = PhotosController(DBSession)</code> it will be possible to upload new photos inside any gallery. To manage the photos inside the first gallery for example we will have to access <code>/manage_photos?gallery=1</code>url.</p>
<p><a href="http://blog.axant.it/wp-content/uploads/2012/01/photoslisting.png"><img src="http://blog.axant.it/wp-content/uploads/2012/01/photoslisting.png" alt="" width="500" height="294" class="alignnone size-full wp-image-445" /></a></p>
<p>Each parameter passed to the <code>EasyCrudRestController</code> is used to filter the entries to show inside the management table and the <code>keep_params</code> option provides a way to keep the filter around. This makes possible to edit the photos of only one gallery at the time instead of having all the photos mixed together. Also when a new photo is created it will be created in the current gallery.</p>
<p>The <code>PhotosController</code> got more customization than the <code>GalleriesController</code>, through the <code>__field_widget_types__</code> and <code>__field_validator_types__</code> options we force the image field to be a file field and using the <code>__field_widget_args__</code> we ensure that the newly uploaded photos have the current user as the author.</p>
<p><code>__table_options__</code> provide a way to customize the management table. The available options are the same as the <a href="http://packages.python.org/sprox/modules/sprox.tablebase.html#sprox.tablebase.TableBase">Sprox TableBase</a> and <a href="http://packages.python.org/sprox/modules/sprox.fillerbase.html#sprox.fillerbase.TableFiller">Sprox TableFiller</a> objects. in this case we hide the indexes of the rows on the database and the gallery itself, as we are managing the photos of a specific gallery we probably don&#8217;t need to know which galleries the photos belong to. Using the <code>__xml_fields__</code> we also specify that the <strong>image</strong> field provides HTML and so doesn&#8217;t have to be escaped. The <code>image</code> entry forces the table to show the image thumbnail for the image column of the table instead of printing the <code>AttachedImage.__repr__</code> as it would by default.</p>
<p>At first sight it might sound a bit complex, but once you start feeling confident, the CRUD extension makes possible to create entire applications in just a bunch of code lines. With just a few lines of code we created a photo gallery with multiple albums support and we can now focus on the <strong>index</strong> and <strong>gallery</strong> templates to make the gallery as pleasant as possible for our visitors.</p>
<p>The complete implementation of the photo gallery is available as a pluggable application on <a href="https://bitbucket.org/_amol_/tgapp-photos">bitbucket</a>, feel free to use it in your TurboGears projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.axant.it/archives/423/feed</wfw:commentRss>
		</item>
		<item>
		<title>Our First Hackathon</title>
		<link>http://blog.axant.it/archives/417</link>
		<comments>http://blog.axant.it/archives/417#comments</comments>
		<pubDate>Mon, 16 Jan 2012 22:38:19 +0000</pubDate>
		<dc:creator>puria</dc:creator>
		
		<category><![CDATA[Opensource]]></category>

		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[food]]></category>

		<category><![CDATA[hackathon]]></category>

		<category><![CDATA[hackers]]></category>

		<guid isPermaLink="false">http://blog.axant.it/?p=417</guid>
		<description><![CDATA[
We are coders, and we love to code. Our job is coding, and we have fun to.
Hence we decided to have fun, just by having a 24h non-stop coding experiment in our preferred and beloved Italian restaurant (well actually a taverna)!
We will have a mini-hackathon tomorrow at 3pm our time, to celebrate together the past [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_419" class="wp-caption alignleft" style="width: 310px"><a href="http://blog.axant.it/wp-content/uploads/2012/01/profile_image.jpg"><img class="size-medium wp-image-419" src="http://blog.axant.it/wp-content/uploads/2012/01/profile_image-300x300.jpg" alt="Axant codes for food" width="300" height="300" /></a><p class="wp-caption-text">Axant codes for food</p></div>
<p>We are coders, and we love to code. Our job is coding, and we have fun to.</p>
<p>Hence we decided to have fun, just by having a 24h non-stop coding experiment in our preferred and beloved Italian restaurant (well actually a taverna)!</p>
<p>We will have a mini-hackathon tomorrow at 3pm our time, to celebrate together the past 2011 working year, that was great! Free Food, free alcohol and a couple of cots is our necessaire for brainstorm and actuate our plan to take over the world!</p>
<p>Actually this &#8220;coding marathon&#8221; it has a subject, all the projects and ideas that will be developed should be related to &#8220;Food / Dining&#8221;!</p>
<p>The products result of the day, if useful, will be developed on field and used by a restaurant and a couple of bars, free of charge. Hence if there are good result could be a first step for a new free-software project.</p>
<p>In fact probably tomorrow we&#8217;ll not have just software projects cause the team is heterogeneous, built of lawyers, designers, creative people, musicians&#8230; and obviously coders!</p>
<p>The plan includes a couple of hours to study the problematics of a restaurant and in particular of our host. The owner will illustrate to us his business processes and we will try to understand were we could help them with our notions.</p>
<p>The next step is to actuate the thoughts into reality in the next 20hrs (: that&#8217;s it, nothing easier huh?</p>
<p>In the next post I&#8217;ll update the outcomes and the people behind it!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.axant.it/archives/417/feed</wfw:commentRss>
		</item>
		<item>
		<title>TurboGears2 DebugBar</title>
		<link>http://blog.axant.it/archives/405</link>
		<comments>http://blog.axant.it/archives/405#comments</comments>
		<pubDate>Sat, 12 Nov 2011 19:30:47 +0000</pubDate>
		<dc:creator>amol</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[turbogears]]></category>

		<guid isPermaLink="false">http://blog.axant.it/?p=405</guid>
		<description><![CDATA[Recently some work has been done to extend the hooks support in TurboGears, to play a little with the new hooks I decided to try creating the famous and envied Django Debug Toolbar. I&#8217;m quite happy of the result and most of the features are there. In a few days I&#8217;ll be able to place [...]]]></description>
			<content:encoded><![CDATA[<p>Recently some work has been done to extend the hooks support in TurboGears, to play a little with the new hooks I decided to try creating the famous and envied Django Debug Toolbar. I&#8217;m quite happy of the result and most of the features are there. In a few days I&#8217;ll be able to place it on a public repository and I&#8217;ll release it concurrently with the 2.1.4 release of TurboGears.</p>
<div id="attachment_409" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.axant.it/wp-content/uploads/2011/11/debugbar.png"><img src="http://blog.axant.it/wp-content/uploads/2011/11/debugbar-300x223.png" alt="Debug Toolbar" width="300" height="223" class="size-medium wp-image-409" /></a><p class="wp-caption-text">Debug Toolbar</p></div>
<div id="attachment_411" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.axant.it/wp-content/uploads/2011/11/timings.png"><img src="http://blog.axant.it/wp-content/uploads/2011/11/timings-300x223.png" alt="Timings" width="300" height="223" class="size-medium wp-image-411" /></a><p class="wp-caption-text">Timings</p></div>
<div id="attachment_412" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.axant.it/wp-content/uploads/2011/11/request.png"><img src="http://blog.axant.it/wp-content/uploads/2011/11/request-300x223.png" alt="Request and Headers" width="300" height="223" class="size-medium wp-image-412" /></a><p class="wp-caption-text">Request and Headers</p></div>
<div id="attachment_413" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.axant.it/wp-content/uploads/2011/11/queries.png"><img src="http://blog.axant.it/wp-content/uploads/2011/11/queries-300x223.png" alt="SQLAlchemy Queries" width="300" height="223" class="size-medium wp-image-413" /></a><p class="wp-caption-text">SQLAlchemy Queries</p></div>
<div id="attachment_414" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.axant.it/wp-content/uploads/2011/11/controllers.png"><img src="http://blog.axant.it/wp-content/uploads/2011/11/controllers-300x233.png" alt="Mounted Controllers" width="300" height="233" class="size-medium wp-image-414" /></a><p class="wp-caption-text">Mounted Controllers</p></div>
<p>The code has been heavily inspired by the Pyramid Debug Toolbar and have to thank the Pyramid team for the good job they did at making the Toolbar code clean and simple.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.axant.it/archives/405/feed</wfw:commentRss>
		</item>
		<item>
		<title>TurboGears2 Performance Improvements</title>
		<link>http://blog.axant.it/archives/400</link>
		<comments>http://blog.axant.it/archives/400#comments</comments>
		<pubDate>Tue, 04 Oct 2011 15:35:48 +0000</pubDate>
		<dc:creator>amol</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[genshi]]></category>

		<category><![CDATA[kajiki]]></category>

		<category><![CDATA[mako]]></category>

		<category><![CDATA[turbogears]]></category>

		<guid isPermaLink="false">http://blog.axant.it/?p=400</guid>
		<description><![CDATA[As recently some effort has been involved in improving the performances of TurboGears2, I was curious to see how much things improved. As usually, the test isn&#8217;t really reliable in any way and was just for fun.
All the graphs report the request/sec the application has been able to perform on my computer with only 1 [...]]]></description>
			<content:encoded><![CDATA[<p>As recently some effort has been involved in improving the performances of TurboGears2, I was curious to see how much things improved. As usually, the test isn&#8217;t really reliable in any way and was just for fun.</p>
<p>All the graphs report the request/sec the application has been able to perform on my computer with only 1 concurrent client. So higher is better.</p>
<p>Here is the comparison between TG2.0 and TG2dev (will be 2.1.4)</p>
<p><img src="https://docs.google.com/spreadsheet/oimg?key=0AuIJBJ437w0BdHNHdUlwclF4WWtJcTBxZzJId0hLT0E&amp;oid=2&amp;zx=lp41836o721b" /></p>
<p>I also compared various setups with different template engines on TG2dev </p>
<p><img src="https://docs.google.com/spreadsheet/oimg?key=0AuIJBJ437w0BdHNHdUlwclF4WWtJcTBxZzJId0hLT0E&amp;oid=1&amp;zx=tjwtm6ymhmbj" alt="" /></p>
<p>The comparison happened on an application similar to the quickstarted one.<br />
Actually as there is no database involved in this application the template engine impacts a lot and so was a good benchmark for the template engines themselves.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.axant.it/archives/400/feed</wfw:commentRss>
		</item>
		<item>
		<title>ACRcms 0.3.5 released with libacr 0.7</title>
		<link>http://blog.axant.it/archives/398</link>
		<comments>http://blog.axant.it/archives/398#comments</comments>
		<pubDate>Fri, 08 Jul 2011 13:47:01 +0000</pubDate>
		<dc:creator>amol</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[acr]]></category>

		<guid isPermaLink="false">http://blog.axant.it/?p=398</guid>
		<description><![CDATA[New features introduced are:

Assets manager, Upload your videos and images using the Asset manager instead of the RDisk if you want to create slices from them. Assets manager will also create thumbnails for everything and will convert the videos to support HTML5
BlogPost view (an HTML view with a title)
Attributes for Pages and Slices
Hide Pages from [...]]]></description>
			<content:encoded><![CDATA[<p>New features introduced are:</p>
<ul>
<li>Assets manager, Upload your videos and images using the Asset manager instead of the RDisk if you want to create slices from them. Assets manager will also create thumbnails for everything and will convert the videos to support HTML5</li>
<li>BlogPost view (an HTML view with a title)</li>
<li>Attributes for Pages and Slices</li>
<li>Hide Pages from menu with hidden=1 attribute</li>
<li>Reorder Pages in menu menu-weight attribute</li>
<li>Add metatag description to pages with description attribute</li>
<li>Automatic Database migrations, never care about changes to the schema when you upgrade acr again, it will be automatically upgraded by acr itself on first visit</li>
<li>Hide edit bars in edit mode to view the slice as a standard visitor</li>
<li>Abstraction layer for encoding data, now each view encodes using EncodedView, so that it will be possible to switch to any key/value encoding or store in the future</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.axant.it/archives/398/feed</wfw:commentRss>
		</item>
		<item>
		<title>TurboGears 2.1.1 released!</title>
		<link>http://blog.axant.it/archives/396</link>
		<comments>http://blog.axant.it/archives/396#comments</comments>
		<pubDate>Sun, 19 Jun 2011 08:59:05 +0000</pubDate>
		<dc:creator>amol</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[turbogears]]></category>

		<guid isPermaLink="false">http://blog.axant.it/?p=396</guid>
		<description><![CDATA[After a reflection moment caused by the need to think what will follow after the pylons and repoze.bfg merge in pyramid the TurboGears2 team has decide to gather up all its forces and give to TurboGears2 its own independent life.
The first steps have been oriented to improve the framework reliability and brought to life the [...]]]></description>
			<content:encoded><![CDATA[<p>After a reflection moment caused by the need to think what will follow after the pylons and repoze.bfg merge in pyramid the TurboGears2 team has decide to gather up all its forces and give to TurboGears2 its own independent life.</p>
<p>The first steps have been oriented to improve the framework reliability and brought to life the <a href="http://jenkins.turbogears.org/view/TurboGears%20Hosted/">TurboGears</a> continuous integrations system and a standard project release process.</p>
<p>After a few months of work 2.1.1 has been released and it brings many fixes and improvements, 2.1.2 is under its way and a 2.2 release with major improvements is already planned!</p>
<p>TG2 Core:<br />
* Fixed dependencies for Python 2.4. Now any packages that are<br />
needed are automatically installed.<br />
* Updated package requirements as high as possible.<br />
* Verified nested RestControllers work as expected<br />
* Added/fixed Kajiki support<br />
* Ignore repoze.who_testutil when running nosetests<br />
* Fixed import order for pylons.middleware<br />
* Fixed crash when PYTHONOPTIMIZE is enabled<br />
* Report a warning about ErrorMiddleware is disabled<br />
* Fixed concurrency issues with use_custom_format<br />
* Fixed 404 errors if a controller uses only custom formats<br />
* Verified that user object is available inside of the error controller/template<br />
* Fixed expansion of arguments on before/after calls<br />
* Fixed wrong header response for 405 error<br />
* Fixed WebOb version requirment. Newer version required<br />
* Added test case to check for replace_header when called from WSGIApp<br />
* Fixed issues with Content-Type header appearing multiples times on 204/205 responses<br />
* Removed redundant hasattr checks on override_template<br />
* Improved support for pylons 1.0 strict_c<br />
* Fixed post traceback, now reports to Pylons correctly<br />
* Added test case to check for spurious content type removal on empty content<br />
* Fixed crash when content type header is missing<br />
* Fixed crash when response Content-Type is set to None<br />
* Fixed support for etags. Pylons 1.0 changes slightly, we support the correct version now<br />
* Added dependency_links and setup.cfg allow_hosts: easy_install TurboGears2 now works<br />
* Fixed DecoratedController. should not call super(), 2.6 revealed a problem<br />
* Fixed Genshi output method. Use XHTML if none specified, instead of XML</p>
<p>TG2 Devtools:<br />
* Fixed Python 2.4 compatibility issues. Dependencies are now automatically specified<br />
* Updated package version requirements as high as possible<br />
* Fixed about.html instructions about where the logo is found<br />
* Set &#8220;zip_safe=False&#8221; by default in the templates now<br />
* Tests fixed, now pass<br />
* Added support for sqlalchemy-migrate<br />
* Added option to choose config file<br />
* Added archive_tw_resources command for projects<br />
* Fixed deprecated redirect calls<br />
* Set Genshi templating method by default to XHTML<br />
* Adding dependency_links: easy_install tg.devtools now works</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.axant.it/archives/396/feed</wfw:commentRss>
		</item>
		<item>
		<title>Asynchronous and Background Tasks with TurboGears2</title>
		<link>http://blog.axant.it/archives/391</link>
		<comments>http://blog.axant.it/archives/391#comments</comments>
		<pubDate>Mon, 02 May 2011 18:06:39 +0000</pubDate>
		<dc:creator>amol</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[turbogears2]]></category>

		<guid isPermaLink="false">http://blog.axant.it/?p=391</guid>
		<description><![CDATA[Want to handle long operations in your web application without having your users wait for minutes?
If you are using turbogears2 you might find tgext.asyncjob useful. Asyncjob extension provides background method calls and helpers to manage your database queries in the asynchronous functions. Makes also easy to implement an AJAX progress bar for your long running [...]]]></description>
			<content:encoded><![CDATA[<p>Want to handle long operations in your web application without having your users wait for minutes?</p>
<p>If you are using turbogears2 you might find <a href="https://bitbucket.org/_amol_/tgext.asyncjob">tgext.asyncjob</a> useful. Asyncjob extension provides background method calls and helpers to manage your database queries in the asynchronous functions. Makes also easy to implement an AJAX progress bar for your long running operations.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.axant.it/archives/391/feed</wfw:commentRss>
		</item>
		<item>
		<title>Mobile devices detection with TurboGears2</title>
		<link>http://blog.axant.it/archives/388</link>
		<comments>http://blog.axant.it/archives/388#comments</comments>
		<pubDate>Tue, 19 Apr 2011 23:00:19 +0000</pubDate>
		<dc:creator>amol</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[turbogears]]></category>

		<category><![CDATA[turbogears2]]></category>

		<guid isPermaLink="false">http://blog.axant.it/?p=388</guid>
		<description><![CDATA[We just released tgext.mobilemiddleware for turbogears2 to make easier to handle templates for mobile devices and detect mobile devices requests.
Indeed it is quite simple to use as it makes possible just to register a different template by using @expoe_mobile decorator which will be used for mobile devices, making possible to create mobile version of web [...]]]></description>
			<content:encoded><![CDATA[<p>We just released <a href="http://bitbucket.org/_amol_/tgext.mobilemiddleware">tgext.mobilemiddleware</a> for turbogears2 to make easier to handle templates for mobile devices and detect mobile devices requests.</p>
<p>Indeed it is quite simple to use as it makes possible just to register a different template by using <em>@expoe_mobile</em> decorator which will be used for mobile devices, making possible to create mobile version of web page by using for example <a href="http://jquerymobile.com/">jquery mobile </a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.axant.it/archives/388/feed</wfw:commentRss>
		</item>
		<item>
		<title>ACRCms web page renew</title>
		<link>http://blog.axant.it/archives/385</link>
		<comments>http://blog.axant.it/archives/385#comments</comments>
		<pubDate>Tue, 19 Apr 2011 22:55:54 +0000</pubDate>
		<dc:creator>amol</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[acr]]></category>

		<guid isPermaLink="false">http://blog.axant.it/?p=385</guid>
		<description><![CDATA[Spent some time renewing the ACRCms web page, I was a bit tired of the old style and wanted something more structured, so here is the new look and feel. Hope everyone enjoys it 
]]></description>
			<content:encoded><![CDATA[<p>Spent some time renewing the <a href="http://www.acrcms.org">ACRCms</a> web page, I was a bit tired of the old style and wanted something more structured, so here is the new look and feel. Hope everyone enjoys it <img src='http://blog.axant.it/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.axant.it/archives/385/feed</wfw:commentRss>
		</item>
		<item>
		<title>Redis Remote Procedure Calls (RPC)</title>
		<link>http://blog.axant.it/archives/378</link>
		<comments>http://blog.axant.it/archives/378#comments</comments>
		<pubDate>Mon, 28 Mar 2011 23:33:42 +0000</pubDate>
		<dc:creator>amol</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[redis]]></category>

		<category><![CDATA[rpc]]></category>

		<guid isPermaLink="false">http://blog.axant.it/?p=378</guid>
		<description><![CDATA[While I&#8217;m not sure if it is a good or really stupid idea I decided to start trying to implement a RPC library on the redis database.
In theory it should be a good idea as you can have a very fast and persistent multi-consumer queue of tasks (like rabbit-mq or other AMQP) which can be [...]]]></description>
			<content:encoded><![CDATA[<p style="28.5px;">While I&#8217;m not sure if it is a good or really stupid idea I decided to start trying to implement a RPC library on the <a href="http://redis.io/">redis</a> database.</p>
<p style="28.5px;">In theory it should be a good idea as you can have a very fast and persistent multi-consumer queue of tasks (like rabbit-mq or other AMQP) which can be worked out to also give answers back. Also using redis permits to quickly distribute work over multiple servers by simply running another server without any change to the code itself.</p>
<p style="28.5px;">If you want to check REPC (yes, this is the only name I have been able to think of&#8230;), you can take a look at <a href="https://github.com/amol-/repc">https://github.com/amol-/repc</a></p>
<p style="28.5px;">Serialization format for data is JSON just because it was something quick to have. Currently my main target is trying to have something with a very small code footprint and reliable enough to be used. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.axant.it/archives/378/feed</wfw:commentRss>
		</item>
	</channel>
</rss>

