On 22 Jan, 2006, at 8:17 am, [EMAIL PROTECTED] wrote:
1- Is there a way I know if the visit is the first time?
If you are writing a Visit Tracking plugin, yes, absolutely: your plugin's new_event method will be called with the new visit_id. Otherwise, you'll need to retrieve the current visit using visit.current() (from turbogears import visit) and check the is_new flag on the returned object. If the return value is None, visit tracking hasn't been enabled.
2- When are the TG_Visit cleans from older visits?
It's up to you to remove the TG_Visit records from your database. Mostly because this record contains important information: when the visit began and when the last expiration was (which is 20 minutes, by default, after the last request made during that visit).
More importantly, these records provide important foreign key information for whatever meaningful data YOU'RE collecting. Otherwise, you'll not know when the events occurred.
I'm pitching a series of articles around TurboGears' support for Identity and Access Management (provided by the Identity framework obviously) and collaborative filtering and implicit personalisation via Visit Tracking. If the pitch is a success, I'll be certain to post the URLs.
-- Jeff Watkins http://newburyportion.com/ Computers, they're just a fad.

