I’ve just checked in revision 255 which contains modifications to the Identity framework.
Probably the most significant is that the default Identity provider, `SqlObjectProvider`, model classes are now prefixed with `TG_`. So you have `TG_User`, `TG_Group`, `TG_Permission`, `TG_SecretToken`. This was necessary because the SQLObject registry feature is broken and prevents you from linking your model objects to the identity model — so you can’t have a foreign key to a user anywhere in your model. However, to prevent naming clashes (because SQLObject doesn’t use fully qualified class names), we had to prefix the classes with `TG_`. I’m *really* not a fan of prefixes like this, but there was no other alternative.
For those of you who would like to implement your own provider or tweak the behaviour of the current provider, you’ll be happy to note that almost all of the functionality that formerly lived in the Filter has been factored out into the `IdentityProvider` base class.
The filter now calls only the following methods:
provider.identity_from_form()
provider.identity_from_cookie()
provider.anonymous_identity()
So if you want to completely change how the cookie is generated, you’ll want to create a subclass of `IdentityProvider` that overrides the methods `identity_from_cookie` and `send_identity_cookie`. Go wild.
Additionally, I removed the thread local storage. The current identity is now stored in the CherryPy request object as `identity`. For backwards compatibility, the current identity is still available as `turbogears.identity.current` and is also still exposed via the `std` kid variable.
Finally, I added checks to the `IdentityWrapper` object (what `turbogears.identity.current` really is) that will detect whether identity management is turned on and throw the appropriate exception. This means you should get better error messages should you attempt to access the current identity when you’ve forgotten to turn on identity management in your config file.
As usual, please let me know if I broke something or haven’t addressed a problem you’ve been encountering.
Some of you may already know that in about a week’s time I will become a father for the first time. My wife has already registered the domain name weewatkins.com so I’d like to create a Web site for her to post photos and short thoughts.
Does anyone have any suggestions of sites I can look at for inspiration. It should be obvious if you’ve seen the last few incarnations of [newburyportion](http://newburyportion.com) and this site that I’m no great graphic artist. Worse, I don’t know any good graphic artists well enough to impose on them for help.
So simple would be good. But any inspirational sites would be a good start.
I’ve always thought of [Paul Thurrott](http://www.winsupersite.com) as a Microsoft Apologist, however, in the last year or so, Paul has written articles that challenge my opinion. His latest article compares Windows Vista Beta 1 with Mac OS X “Tiger”, and while I agree with Scott McNulty of [TUAW](http://tuaw.com) that comparing a Beta to a finished product isn’t particularly meaningful, I was stunned by one of the opening paragraphs of Paul’s piece:
> Microsoft claims that Windows XP and, by extension, Windows Vista, were architected for security, thanks to their NT roots. That claim is, however, bogus. Windows NT was designed in the pre-Internet days, and though the system’s architecture is extensible, modern Windows versions are further hobbled by the inclusion of the buggy and insecure IE Web browser and other design mistakes. In short, Windows is a house of cards that seems increasingly incapable of handling today’s demands.
This certainly doesn’t read like something a Microsoft Apologist would write. There’s good stuff there. Go check out the comparison for yourself: [Windows Vista Beta 1 vs. Mac OS X “Tiger” (Part 2)](http://www.winsupersite.com/showcase/winvista_beta1_vs_tiger_02.asp).
Recently there’s been some discussion on the TurboGears mailing list about how to get around a flaw in [SQLObject](http://sqlobject.org) where the classes from the SQLObjectProvider model are causing conflicts with existing model classes sharing the same names.
It’s also become clear that many people *want* to extend the default model to include additional fields and capabilities.
So it makes sense to provide a short tutorial on how to create an alternate model for the SQLObjectProvider. But first, I need to explain how the Filter processes each incoming request.
Read Creating Your Own Identity Model »
There are lots of Web sites out there you could read; so, why should you read this one?
### Who is Jeff Watkins? ###
First of all, I’m a nerd. Sometimes it doesn’t show, but the moment a discussion about one of my favourite technologies starts it’s like a fever comes over me and I have to take part.
I’ve been a nerd all my life: My first software development job was in High School writing Intel 80386 protected-mode assembly for an embedded system. Yeah. Nerd.
Whether you believe it or not, the second computer language I learned (after BASIC) was Lisp. I still have nightmares about parenthesis swarming out of my closets and devouring me. I learned C++ before I learned C. And Smalltalk before either of them.
Back in 1995, I was hired by a small software company in Seattle to build a Web version of their flagship application — it turns out to have been one of the first Web applications ever written. I didn’t think up the idea of writing a Web application, but I count myself lucky to have been involved.
Since then, I’ve drifted into creating user interfaces for Web and Windows applications. I’m definitely no Web designer (I think this Web site speaks to that), but I know my way around Photoshop and understand way more about CSS and design than you’d expect from someone who adores JavaScript.
### What’s _Nerd_ About? ###
This site really serves two purposes. First, it gives me a venue to vent my frustration with stupid software and hardware ([The Searing Pain of Using Windows](http://nerd.newburyportion.com/2005/12/searing-pain), [A Long Way to Go to Release](http://nerd.newburyportion.com/2006/07/a-long-way-to-go-to-release), [Microsoft Still Doesn’t Get Standards](http://nerd.newburyportion.com/2006/01/microsoft-still-doesnt-get-standards), and [Who Designs These Things?](http://nerd.newburyportion.com/2006/01/who-designs-these-things)). Second, I’ve attempted to document some of the thorny solutions to the problems I’ve encountered developing cool UIs ([Building Mozilla SpiderMonkey for Mac OS X](http://nerd.newburyportion.com/2006/07/building-mozilla-spidermonkey-for-mac-os-x), [Going Global](http://nerd.newburyportion.com/2006/07/going-global), and [Safari Can’t REST](http://nerd.newburyportion.com/2005/10/safari-cant-rest)).
If along the way I can help someone avoid the problems I encountered, that’s _so_ cool.
Of course, it would be great if I had a portfolio of some of the cool applications I’ve built, but none of the recent ones have been public facing. That means if I so much as post a screen capture, I’ll find my butt in court. I’m working on this problem…