Posts Tagged ‘Sprox’

Pycon 2010 Dump… Sorta

Monday, March 1st, 2010

I decided this year I am going to forego my Pycon dump, and focus on the news that matters most to my readership.  There are plenty of reviews of talks, and I went to a bunch of good ones, had a great time at wsgi house, blah, blah, blah.  What _you_ probably care about is what’s cutting edge in TurboGears, and the sprints are where it’s at.

We had 12 sprinters on day 1, I think 10 on day 2 and then 8, 4.  So yeah, there’s some manpower behind the next-gen TG stuff.  And that was our focus.  I don’t think anyone lifted a 2.0 finger, all the effort has gone into 2.1.  With Luke Macken’s help, we closed 21 tickets.  I think we have all the road-blocks out of the way for the forthcoming b2 release, which will likely be the last beta before release candidates.  The api is pretty solid now, I don’t expect to expand it an more, so it’s going to be feature frozen in b2.  There are only 2 blocker tickets before 2.1rc1.

Mark Ramm and Jenny Steele overhauled the visual components of the 2.1 docs and came up with a better way of updating our public face.  Jenny has also put forth an effort in c5t (a new cms based on mongo and tg2) to improve our image library capabilities.  She also spent some time updating the TG admin so it looks way better now.  I’ll post some screenshots when I do the 2.1b2 release.

C5t got quite a bit of love actually.  Rick Copeland added Ming 0.2 support since the api changed a bit from 0.1. Christopher Brown fixed a bunch of the styling.  Kevin Mitchell added some tests.  Jason Galyon worked on per-page authz, and Jorge Vargas worked on the editor implementation.  I created a new c5t.website project so that we can work on the core and the public image independently.  This is valuable especially since c5t does not ship with TW1, but we wanted to add mongodb support to the admin on the website, and TW1 is required for Sprox to do it’s magic in the admin presently.

Kai Groner and Eric J (sorry I don’t know your last name) both made some contributions to Sprox.  Eric added Ming support after I refactored the database orm later organization in Sprox.  Ming is a layer on top of pymongo that allows you to enforce schemata in your collections.  This is perfect for selecting validators (the validator in the schema becomes Sprox’s schema), and fairly simple to select widgets with.  Eric had every provider test that works with SAORM working, except for one that looks like a pymongo bug on the limit operator.  Kai worked on handling inline-forms in Sprox.  Looks like most of the provider code is working, we just need to add in tw.dynforms in an intelligent way to hook the rest of the application up.  While this is not a trivial task, it looks as if we are about half-way there for supporting inline forms. All of this work will go into sprox 0.7.

I also spent some time with Sprox, and added jquery support, but it’s not ready for release.  At the end of the sprints I had a working jquery table with pagination in the TG Admin, but some polish is going to be required to get that fully working.  When I’m done, you will be able to easily swap between nothing, dojo, and jquery, and mootools support, or mix and match at any level.  You can also switch between mongo, or any rdbms SA supports, and hopefully couchdb soon.  It’s kinda scary that’s true.

Pycon 2009

Wednesday, February 4th, 2009

So, Pycon registration has been up for a few days, I will be speaking both on and off-podium (read: open space) and providing assistance to and presenting tutorials.  Here is a run down of what I am planning in case you wanted a little bit more in-depth information.

Tutorials:

Turbogears2 Beginner and Intermediate:

I will be assisting Mark Ramm by giving individuals help installing and using the new TurboGears2 framework.  Mark is an experienced tutorial presenter, an expert in the technology, and in general a fun character to spend a few hours with.  When you leave his tutorials you should expect to have a working version of TG2 on your machine, along with an understanding of Model, View, and Controller paradigms.  Middleware, Forms, and REST will also be covered.  One note, if you are getting started with TG2, it’s best to have it installed and running if you plan to attend only the Intermediate Section.  We will not be going over installation in the second-half.

 Toscawidgets: Test Driven Modular Ajax:

I am presenting this tutorial which will describe how to use the valuable Toscawidgets package to create web content.  If you are currently use WSGI technology, and are interested in creating reusable, modular web content, this is a perfect way to get started.  I will show you how to configure TW middleware to work with pylons (which is applicable to other frameworks like repoze.bfg, paste, or even plone/Grok).  I will then describe how you might use this middleware to generate web forms.  The last few hours of class will be devoted to using the JavaScript utilities of TW to create an Ajaxified website, and test it using YUITest.

The Big F’ing Tutorial: Development Using the repoze.bfg Web Framework

I will assist/present with Chris McDonough about this up-and-coming framework who’s goals are to utilize bits of the zope 3 framework, wsgi, and new technologies to make a lighting-fast web server.  Those of you who are familiar with Zope technologies may be interested to find how nicely some of the familiar bits of zope are integrated with wsgi with repoze.bfg.

 Presentations:

Using Sphinx and Doctests to provide Robust Documentation

This is a 1/2 hour slot which describes how you can integrate tested documentation with your source code… with sanity!  I go over a quick install of Sphinx, and use some screencasts to demenstrate how to add, run, and display doctests using it.

Open Space:Agile Development with SQLAlchemy and Python Testing Tools

I really enjoy giving this talk, and even though it was not accepted as a formal talk, I will find a venue by way of Open Space to express my knowledge of Testing, SA, and Nose.  I have given this talk a few times now, and it’s fairly polished.  My presentation, while on some dry topics, won’t put you to sleep.  Carefully prepared screencasts and photograph-punctuated slides makes the 45 minutes breeze by.  Questioneers/Hecklers welcome!

 Sprint Topics

I want to spend some time with the Dispatch of TG2, and probably push Sprox further a bit.  If you are just starting with TG, please feel free to contribute.  Sprinting is a great way to learn a lot from the experts in the domain.  We usually do a meet-greet-install the night before the sprints.  Oh, and I’ve been known to provide refreshments to all of our sprinting hordes (read: FREE BEER).

So, I hope to see all of you there!  If you see me in the hall, feel free to introduce yourself and tell me what you are using Python for!

Coding Binge

Tuesday, January 27th, 2009

I haven’t written to the blog in a while.  Quite frankly, I’ve been busy.  In the last 30 days, I have released 3 software new packages, updated 1, deprecated 1, participated in a sprint that lasted a virtual 2 weeks, closed countless tickets, and pushed forward TG2 functionality.

TG2b4 was released last Saturday.  This was mostly a bug-fix release, but b3 is where the new functionality really came into the scene.  TG2b3 is the first build to include Sprox, a new library for schema-generated widget generation.  Sprox is the offspring of DBSprockets.  I decided I liked the declarative part of DBSprockets so much I wanted to spin it off as it’s own entity.  Sprox looses DBSprocket’s table-based dependency, utilizing the mapping provided by SQLAlchemy.  I realized that much of DBSprocket’s code was doing precisely what SQLSoup was designed to do, and decided to focus my efforts on making and extremely configurable widget base.  The result was a considerable removal of the cruft that was associated with DBSprockets.  Sprox releases with an excellent documentation base provided by Sphinx.

There has been a bit of resistance to Sprox, people were/are confused/upset about my providing yet more options for schema based widget generation.  The fact is I have yet to find anything that performs as well as Sprox from a developer/speed standpoint, and I needed to provide our TurboGears user base with a better way to administrate their site, and also allow them to use that tool component-wise in their system.  I think this method for developing widgets is well done in other frameworks, and we need a solid answer to this problem.  Sprox is just that.

The next step was to re-work Catwalk to use Sprox.  This took a little effort, and I put in RESTful URLs while I was at it, but struggled with making the URLs work within TG2’s dispatch system.  The result was as close to REST as you can get without conforming to a set standard.

The result of hacking REST into Catwalk got me thinking, and I decided to implement content-type dispatch as well as RESTful dipatch in TG2.  I went back for another round on Catwalk, and converted it over to the standard.

I’ve also been toying around with Dojo at NREL.  I’m pretty much done with ExtJS due to licensing issues, a not-so-hot codebase, and weak support from IRC.  It’s bad when you go on to ask a question on the channel as a 6 month-user of a software project and end up spending all your time answering everyone else’s questions (as the most experienced person in the room).  Something must be said for an organization that does not push paid consulting as a primary focus on their website…  #dojo has been an exceptional resource for getting my work done.  Those guys know their software, and lend a great hand to help you with it.

Back to the topic at hand… I was able to shoe-horn Dojo into Sprox with little effort, and implemented DojoCatwalk, which worked, but was ultimately not what I wanted.  What I really wanted was configurability.  I started work on tgext.admin, which was supposed to provide enough functionality to replace tgcrud, a command to auto-create crud in your own TG application.  To support tgext.admin, I created a new package called tgext.crud, which provided a CrudRestController, which is a simple way of providing crud for any object in your model.  AdminController combines this functionality with that of Mark’s lookup code to provide a fast, configurable set of tables/forms/etc for all objects in your model.  AdminController takes a declarative AdminConfig as input which provides a consistent way to create your administrative toolset.  Did I mention it does Dojo tables with ajax loading?  Yeah.

I’m not done with this binge yet.  Catwalk is going to mutate one more time before I’m through with it.  It is going to become a default-configured AdminController specifically designed to work within the context of a quickstarted TG2 application.  I had one blocker ticket which was solved last weekend, so it’s time to get Catwalk good and finished.