First, I apologise for breaking everything again. Really. I don't get
sadistic glee from completely changing around the structure of the
Identity framework every few days. OK, maybe I get just a little
sadistic glee, but it's good for you. It builds character...
Second, there is now an automatic visitor tracking method built into
TurboGears. You'll be handed a cookie with your visit_key (an SHA1
hashed version of datetime.now()) when you make your first request.
And if you're idle for longer than visit.timeout (config variable)
minutes, you'll get a new visit on your next request.
This means the cookie from Identity has gone away. Too many cookies
is fattening. And once I figure out exactly how to piggyback on the
CherryPy session cookie, I'll use that if the session filter is enabled.
You can also add plugins that handle visit events (new_visit and
record_request) via an EntryPoint in the turbogears.visit section.
Currently, Identity is the only visit tracking plugin.
You can also access the current visit ID via
turbogears.visit.current_id(). This can be helpful when you want to
link the current visit to events (like viewing a product).
Third, I simplified the Identity framework a bit by removing the
model folder and rolling the classes into the soprovider file. Plus I
moved soprovider up into the identity folder.
So, if you have the following in your model.py file:
from turbogears.identity.model.somodel import *
Change that to:
from turbogears.identity.soprovider import *
or from turbogears.identity.soprovider import TG_User, TG_Group,
TG_Permission
Finally, I'm thinking of adding a default login controller and
templates to the quickstart project. Does anyone have any objections?
--
Jeff Watkins
http://newburyportion.com/
In the USDA study [of the meat packing industry conducted in 1996]
78.6 percent of the ground beef contained microbes that are spread
primarily by fecal material. The medical literature on the causes of
food poisoning is full of euphemisms and dry scientific terms:
coliform levels, aerobic plate counts, sorbitol, MacConkey agar, and
so on. Behind them lies a simple explanation for why eating a
hamburger can now make you seriously ill: There is shit in the meat.
-- Eric Schlosser, Fast Food Nation