Configuring Self-Referential Relationships in TurboGears 2.1
drks — Thu, 2010-07-08 22:13
It has been a while since I felt inclined to put my face through a wall, and endure physical pain rather than be defeated yet another hour (or day) on a Python/TurboGears road block. Well, over the last few days I have been stumped by self-referential relationships in SQLAlchemy. For those not familiar, this is a simple yet common scenario where a Model has a parent or child of itself that is the same Model. For example:
Cement CLI Application Framework for Python 0.8.2 (stable) Released
drks — Mon, 2010-05-10 21:43
The latest stable release of Cement has been pushed to PyPi and is now available for installation and upgrade. This is mostly a bug fix and clean up release, and includes the following changes:
+ Enable passing output to a file rather than STDOUT (GH#20)
+ Support engine:template mix from @expose()
+ Namespace get_config() returns ConfigObj object (as is documented)
+ Set all namespace's config options per cli options (if they have the key)
regardless of what namespace is called. I.e. If --myoption is passed to
a command in the 'mynam' namespace, mynam.config['myoption'] is set as well
as any other namespace that has that config key.
+ log.warn on OptionConflictError
- Don't render genshi output if --quiet is passed
- Resolve GH#6 Make plugin templates pass full version, required_cement_api,
etc when registering their namespace
- Resolve GH#27 Remove unused app_basepath from config templatesHack onward!
Python/TurboGears: Modifying request.environ Before Controller Dispatch
drks — Wed, 2010-04-07 10:42
Two days. Two days of banging my head against a wall trying to figure out the simplest of issues. "How do I modify request.environ before controller dispatch"? Why would you want to do that you ask. Well, it started with my last article API Key [Token] Based Authentication in TurboGears 2.1. In it I described my quest to enable token/key based authentication, of which I was successful... but ne'r did I think I would be forced to revisit the issue.
Cement CLI Application Framework for Python 0.8 Stable Released
drks — Tue, 2010-03-23 17:57
The latest version of Cement is now available for direct download from PyPI. The version includes the following changes from the previously stable 0.6:
0.8 - Mar 24, 2010
-----------------------------------------------------------------------------
+ 0.8 Stable Release
0.7.3 - unreleased
-----------------------------------------------------------------------------
+ Paster now creates 'yourapp-plugin-yourplugin' rather than a plural
'-plugins-' which is more standard.Python: API Key [Token] Based Authentication in TurboGears 2.1 [UPDATED]
drks — Thu, 2010-03-18 18:36
I came across an interested stumbling block this week whilst starting a new project. Part of the project is a TurboGears 2.1 web app [we'll call TG from now on] that also serves as a RESTful API Interface which returns JSON. The problem I had was, how do I authenticate with TG in a standard 'API' type fashion... from which I'm doing so from a command line application. I don't want to have to manage cookies on the client side, I just want secure access...
Cement CLI Application Framework for Python 0.7.2dev - Testers Welcome
drks — Sat, 2010-03-06 11:06
Hello hello. I've spent quite a bit of time cleaning up The Cement CLI Application Framework and pushing it closer to a one-point-oh release. For the most part I'm completely happy with the code, but I know there will be some things that pop up. Also, before a true 1.0 release I really need to add test cases. Dunnnn dunnnnnnnnnn.
Ruby ParseConfig 0.5.2 Released
drks — Sat, 2010-02-27 19:08
The latest version of Ruby ParseConfig library is now available. This release has the following changes:
Sat Feb 27, 2010 - v0.5.2 - Re-releasing under MIT License. - Fixed issue with the add() method where if you added a group outside of the import_config() method, the group would not be properly added to self.groups[]. - Added feature that if you attempt to add a group that already exists, the groups will be merged together. Any existing params in the original group will be overwritten by the new ones.
Cement CLI Application Framework Version 0.6 Released!
drks — Wed, 2010-02-03 10:42
I've just finished releasing Cement-0.6 to PyPi. I'm really proud of how the project has turned out, and how much time it currently saves me every time I start a new project. I really hope the community starts to work with it and that it provides a solid development platform from which to base their applications.
This version has a lot of enhancements, and provides the following features:
* Multiple Configuration file parsing (default: /etc, ~/)
* Command line argument and option parsing
Python: Unique Username, Groupname, Email Validators for TurboGears 2.0 Form Widgets
drks — Thu, 2009-12-31 00:34
Disclaimer: This is a rough brain dump. I plan on doing a proper hello world in the near future, but wanted to get this somewhere accessible so I didn't forget about it.
I came across a rather annoying issue of how to properly handle duplicate usernames, groupnames, and email addresses in turbogears 2. What I came up with was a set of validators that can be added to chained_validators on your form validation. I'm using the dMirr project as an example of how I'm using these validators:
A Better Way To Write Linux Command Line Applications with Python
drks — Thu, 2009-12-17 02:41
I've spent the last week or so working on a new project to standardize how I write Linux command line applications, and also make it easier to reuse helper code and plugins. The result is the Cement CLI Application Framework for Python.
RSS Feed