Visit Tracking & Identity (Revision 476)

1 view
Skip to first unread message

Jeff Watkins

unread,
Jan 8, 2006, 9:34:43 AM1/8/06
to turbo...@googlegroups.com
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


Mike Kent

unread,
Jan 8, 2006, 10:01:20 AM1/8/06
to TurboGears
I just updated to this latest revision, and now attempting to log into
my project gives me an exception with a traceback that ends in:

OperationalError: (1054, "Unknown column 'tg_user.child_name' in 'field
list'")

Shouldn't that be 'TG_User' rather than 'tg_user'?

Ronald Jaramillo

unread,
Jan 8, 2006, 10:08:00 AM1/8/06
to turbo...@googlegroups.com
>
>
> Finally, I'm thinking of adding a default login controller and
> templates to the quickstart project. Does anyone have any objections?
>

+1
Cheers
Ronald

> --
> 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
>
>

________________________________
Ronald Jaramillo
mail: ronald AT checkandshare DOT com
blog: http://www.checkandshare.com/blog

Jeff Watkins

unread,
Jan 8, 2006, 10:16:26 AM1/8/06
to turbo...@googlegroups.com
Actually, tg_user is the name of the table and TG_User is the name of the class. Per ticket #??? (Trac down again?) all the default Identity model classes are InheritableSQLObjects. This means they have an additional column 'child_name'.

You can either drop the tables or alter them to have the child_name column (TEXT in SQLite).

One of the nifty features of the latest Identity framework is that it will automatically create the necessary tables (like CatWalk) without you having to munge sqlobject.txt in your egg info.

-- 

Jeff Watkins

http://newburyportion.com/


Computers, they're just a fad.



Jeff Watkins

unread,
Jan 8, 2006, 11:16:37 AM1/8/06
to turbo...@googlegroups.com
100% of all respondents agreed: adding Identity support to quickstart is +1. Therefore, starting with revision 478, you get methods for login and logout in your root controller and a login.kid template.

Identity still isn't enabled by default. So you'll want to change identity.on to True in your config file. Then create a user using CatWalk. Then login.

On 8 Jan, 2006, at 10:08 am, Ronald Jaramillo wrote:

Finally, I'm thinking of adding a default login controller and templates to the quickstart project. Does anyone have any objections?


+1

Cheers

Ronald


"Advertising directed at children is inherently deceptive and exploits children under eight years of age."

-- American Academy of Pediatrics



David Stanek

unread,
Jan 8, 2006, 11:20:13 AM1/8/06
to turbo...@googlegroups.com


On 1/8/06, Jeff Watkins <je...@newburyportion.com> wrote:
100% of all respondents agreed: adding Identity support to quickstart is +1. Therefore, starting with revision 478, you get methods for login and logout in your root controller and a login.kid template.

Identity still isn't enabled by default. So you'll want to change identity.on to True in your config file. Then create a user using CatWalk. Then login.


With a quickstarted project I now get:

2006/01/08 11:19:28  INFO Traceback (most recent call last):
  File "/home/dstanek/vpython/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py", line 269, in run
    applyFilters('beforeMain')
  File "/home/dstanek/vpython/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py", line 641, in applyFilters
    method()
  File "/usr/local/src/turbogears/turbogears/visit.py", line 55, in beforeMain
    visit=self.get_visit()
  File "/usr/local/src/turbogears/turbogears/visit.py", line 90, in get_visit
    return self.new_visit()
  File "/usr/local/src/turbogears/turbogears/visit.py", line 73, in new_visit
    visit= TG_Visit( visit_key=visit_key, expiry=now+self.timeout )
  File "/home/dstanek/vpython/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/main.py", line 1197, in __init__
    self._create(id, **kw)
  File "/home/dstanek/vpython/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/main.py", line 1224, in _create
    self._SO_finishCreate(id)
  File "/home/dstanek/vpython/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/main.py", line 1248, in _SO_finishCreate
    id, names, values)
  File "/home/dstanek/vpython/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/dbconnection.py", line 752, in queryInsertID
    return self._dbConnection._queryInsertID(
  File "/home/dstanek/vpython/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/sqlite/sqliteconnection.py", line 106, in _queryInsertID
    c.execute(q)
  File "/home/dstanek/vpython/lib/python2.4/site-packages/sqlite/main.py", line 237, in execute
    self.con._begin()
  File "/home/dstanek/vpython/lib/python2.4/site-packages/sqlite/main.py", line 503, in _begin
    self.db.execute("BEGIN")
OperationalError: database is locked


-- David

Jeff Watkins

unread,
Jan 8, 2006, 11:25:14 AM1/8/06
to turbo...@googlegroups.com
I know this is not the answer you want, but "I don't". I have no idea what could be causing this. To the best of my knowledge I'm using documented SQLObject APIs.

What DB are you using?

Does this happen only the first time you start the project? Or does it happen every time?

On 8 Jan, 2006, at 11:20 am, David Stanek wrote:

With a quickstarted project I now get: 

"Not everything that can be counted counts, and not everything that counts can be counted."

-- Albert Einstein



Dave Warnock

unread,
Jan 8, 2006, 11:39:01 AM1/8/06
to turbo...@googlegroups.com
Jeff,

> What DB are you using?

From File


"/home/dstanek/vpython/lib/python2.4/site-packages/sqlite/main.py", line
503, in _begin
self.db.execute("BEGIN")

I guess sqlite.

Dave

David Stanek

unread,
Jan 8, 2006, 11:49:07 AM1/8/06
to turbo...@googlegroups.com
To reproduce is easy:
1. tg-admin quickstart a project
2. Change the dev.cfg to use a sqlite db
3. tg-admin sql create
4. Start the app
5. Hit it in the browser and get a traceback

Why would you be using the database at all for me. I have identity off, which is the default.

-- David

Jeff Watkins

unread,
Jan 8, 2006, 12:11:17 PM1/8/06
to turbo...@googlegroups.com
Duh. I'm blind today.

On 8 Jan, 2006, at 11:39 am, Dave Warnock wrote:

I guess sqlite.


-- 

Jeff Watkins

http://newburyportion.com/


"Daddy, I want a purple iMac. And I want ice cream!"

-- Unidentified 7-year-old to his father.



Jeff Watkins

unread,
Jan 8, 2006, 12:12:31 PM1/8/06
to turbo...@googlegroups.com
On 8 Jan, 2006, at 11:49 am, David Stanek wrote:

To reproduce is easy:
1. tg-admin quickstart a project
2. Change the dev.cfg to use a sqlite db
3. tg-admin sql create
4. Start the app
5. Hit it in the browser and get a traceback

I'll check this.


Why would you be using the database at all for me. I have identity off, which is the default.

The visit tracking hits the database. To create and then update the expiration of the visit.

Democracy n: A country where the newspapers are pro-American.



David Stanek

unread,
Jan 8, 2006, 12:33:11 PM1/8/06
to turbo...@googlegroups.com
On 1/8/06, Jeff Watkins <je...@newburyportion.com> wrote:

On 8 Jan, 2006, at 11:49 am, David Stanek wrote:
Why would you be using the database at all for me. I have identity off, which is the default.

The visit tracking hits the database. To create and then update the expiration of the visit.

You hit it even when identity is turned off? That would ensure that TG could not be used for a highly scalable application. I am alright with identity not being scalable at this point, but I think it would be a mistake for TG.

-- David

Alberto

unread,
Jan 8, 2006, 1:04:32 PM1/8/06
to TurboGears
Jeff, I'm beginning to hate you :)
I'm going to take a break, have some coffee, and re-study, for the
third time this week, TG's beautiful identity framework... and I'll
probaly throw my id. subclasses away for the moment as It'll be easier
to keep up with your, I'm sure hard, work.

Please, stabilize this soon as I'm on the edge of a nervous
breakdown...

Just exagerating a bit, keep it up...

Alberto

Jeff Watkins

unread,
Jan 8, 2006, 1:09:07 PM1/8/06
to turbo...@googlegroups.com
I tried these exact steps and was unable to reproduce the problem. Would you send me the project? Maybe there's something different between our setups.

On 8 Jan, 2006, at 11:49 am, David Stanek wrote:

David Stanek

unread,
Jan 8, 2006, 1:21:42 PM1/8/06
to turbo...@googlegroups.com
See attached.

The VisitorFilter needs to be configurable. Being on by default is insane and will prevent TG from working in the enterprise.

On 1/8/06, Jeff Watkins < je...@newburyportion.com> wrote:



--
David Stanek
www.roninds.net

Gustavo Sverzut Barbieri

unread,
Jan 8, 2006, 1:24:34 PM1/8/06
to turbo...@googlegroups.com
On 1/8/06, Jeff Watkins <je...@newburyportion.com> wrote:
> I tried these exact steps and was unable to reproduce the problem. Would you
> send me the project? Maybe there's something different between our setups.

Hi Jeff,

I also have the same problem, and have some other information:

dev.cfg:
sqlobject.dburi="sqlite:///tmp/wiki.sqlite"

Instead of launching App, you can launch toolbox from tg-admin, it
will also give you the traceback.

Interesting point: you said it creates tables automatically, but it
doesn't. running:
sqlite /tmp/wiki.sqlite
sqlite> .tables

show just my tables (created with tg-admin sql create). Maybe the
problem is that you acquire the lock, try to insert items and it fails
(raises exception), then you ignore the exception but doesn't free the
lock. That's my guess.. I didn't check the code to see if it's true.

--
Gustavo Sverzut Barbieri
--------------------------------------
Computer Engineer 2001 - UNICAMP
Mobile: +55 (19) 9165 8010
Phone: +1 (347) 624 6296; 0812...@sip.stanaphone.com
Jabber: gsbar...@jabber.org
ICQ#: 17249123
MSN: barb...@gmail.com
GPG: 0xB640E1A2 @ wwwkeys.pgp.net

Leandro Lucarella

unread,
Jan 8, 2006, 1:21:51 PM1/8/06
to turbo...@googlegroups.com
Alberto, el domingo 8 de enero a las 10:04 me escribiste:

>
> Jeff, I'm beginning to hate you :)
> I'm going to take a break, have some coffee, and re-study, for the
> third time this week, TG's beautiful identity framework... and I'll
> probaly throw my id. subclasses away for the moment as It'll be easier
> to keep up with your, I'm sure hard, work.
>
> Please, stabilize this soon as I'm on the edge of a nervous
> breakdown...

You are using unreleased, ultra-alpha, in-mega-development code, this are
the rules =)

--
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
.------------------------------------------------------------------------,
\ GPG: 5F5A8D05 // F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05 /
'--------------------------------------------------------------------'
Karma police
arrest this girl,
her Hitler hairdo
is making me feel ill
and we have crashed her party.

Leandro Lucarella

unread,
Jan 8, 2006, 11:20:09 AM1/8/06
to turbo...@googlegroups.com
Jeff Watkins, el domingo 8 de enero a las 09:34 me escribiste:

> Finally, I'm thinking of adding a default login controller and
> templates to the quickstart project. Does anyone have any objections?

What about doing it optional? Like tg-admin quickstart --with-identity

--
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
.------------------------------------------------------------------------,
\ GPG: 5F5A8D05 // F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05 /
'--------------------------------------------------------------------'

Bald men with no jobs and no money who live with their parents don't approach
strange women.
-- George Constanza

Jeff Watkins

unread,
Jan 8, 2006, 1:27:14 PM1/8/06
to turbo...@googlegroups.com
Are you using sqlite2 or sqlite3?

On 8 Jan, 2006, at 1:24 pm, Gustavo Sverzut Barbieri wrote:
Interesting point: you said it creates tables automatically, but it
doesn't. running:
sqlite /tmp/wiki.sqlite
sqlite> .tables

Getting an education was a bit like a communicable sexual disease. It made you unsuitable for a lot of jobs and then you had the urge to pass it on. 

-- (Terry Pratchett, Hogfather)



Jeff Watkins

unread,
Jan 8, 2006, 1:29:02 PM1/8/06
to turbo...@googlegroups.com
Sorry, but the attachment doesn't seem to have come through the mailing list intact. Would you please send it to me directly.

<tester.tar.gz>

“In science it often happens that scientists say, ‘You know that’s a really good argument; my position is mistaken,’ and then they actually change their minds and you never hear that old view from them again. They really do it. It doesn’t happen as often as it should, because scientists are human and change is sometimes painful. But it happens every day. I cannot recall the last time something like that happened in politics or religion.” Carl Sagan, 1987

David Stanek

unread,
Jan 8, 2006, 1:30:16 PM1/8/06
to turbo...@googlegroups.com
I think creating the tables may be failing or not happening at all.

-- David

Gustavo Sverzut Barbieri

unread,
Jan 8, 2006, 1:34:30 PM1/8/06
to turbo...@googlegroups.com
On 1/8/06, Jeff Watkins <je...@newburyportion.com> wrote:
> Are you using sqlite2 or sqlite3?

$ sqlite -version
2.8.16

I also have sqlite3 in parallel, it cannot open /tmp/wiki.sqlite
("Error: file is encrypted or is not a database").

I think python-sqlite was compiled against sqlite2, there is any
problem? I'm recompiling it with v3 to ensure it's not the problem.

Jeff Watkins

unread,
Jan 8, 2006, 1:35:59 PM1/8/06
to turbo...@googlegroups.com
Well, it's just that I'm using SQLite 3 which might explain why you see the problem and I don't.

On 8 Jan, 2006, at 1:34 pm, Gustavo Sverzut Barbieri wrote:


On 1/8/06, Jeff Watkins <je...@newburyportion.com> wrote:
Are you using sqlite2 or sqlite3?

$ sqlite -version
2.8.16

I also have sqlite3 in parallel, it cannot open /tmp/wiki.sqlite
("Error: file is encrypted or is not a database").

I think python-sqlite was compiled against sqlite2, there is any
problem? I'm recompiling it with v3 to ensure it's not the problem.

-- 

Jeff Watkins

Elvelind Grandin

unread,
Jan 8, 2006, 1:36:26 PM1/8/06
to turbo...@googlegroups.com
We could even continue along that line with

tg-admin quickstart --advanced
> do you need identity (Y/N) y
> do you need some other feature (Y/N n


--
cheers
elvelind grandin

Gustavo Sverzut Barbieri

unread,
Jan 8, 2006, 1:42:59 PM1/8/06
to turbo...@googlegroups.com
On 1/8/06, Jeff Watkins <je...@newburyportion.com> wrote:
> Well, it's just that I'm using SQLite 3 which might explain why you see the
> problem and I don't.

Updated to sqlite 3.2.1 an pysqlite 2.0.5 and it works.

Jeff Watkins

unread,
Jan 8, 2006, 1:56:03 PM1/8/06
to turbo...@googlegroups.com
Interesting. That strikes me as another limitation of SQLObject. I'll have to hunt around for a work around.

On 8 Jan, 2006, at 1:42 pm, Gustavo Sverzut Barbieri wrote:

Updated to sqlite 3.2.1 an pysqlite 2.0.5 and it works.


-- 

Jeff Watkins

Michele Cella

unread,
Jan 8, 2006, 3:47:19 PM1/8/06
to TurboGears
+1

A quickstarted project should be kept barely simple IHMO.

What I would really like (more than an advanced option for tg-admin) is
a set of command that you can use even after you quickstarted the
project, like Rails generate scripts.

I mean, tg-admin ATM helps you only at the beginning (app skeleton) but
it would be nice to use it even for others commons tasks you have to do
during development like:
- a new controller
- identity support
- a new widget
- a new template that extends your master.kid
- a unit test for your controller
- a template to customize a widget
...

What do you think?

Ciao
Michele

Michele Cella

unread,
Jan 8, 2006, 3:53:49 PM1/8/06
to TurboGears

Same error here.

I was going to test your fix for the NoneType error. :-(

Ciao
Michele

Jeff Watkins

unread,
Jan 8, 2006, 3:55:33 PM1/8/06
to turbo...@googlegroups.com
Are you running SQLite version 2 or 3? At least one other person saw these errors go away after moving from 2 to 3.

On 8 Jan, 2006, at 3:53 pm, Michele Cella wrote:

Same error here.


I was going to test your fix for the NoneType error. :-(


Jorge Godoy

unread,
Jan 8, 2006, 3:55:44 PM1/8/06
to turbo...@googlegroups.com
"Michele Cella" <michel...@gmail.com> writes:

> +1
>
> A quickstarted project should be kept barely simple IHMO.
>
> What I would really like (more than an advanced option for tg-admin) is
> a set of command that you can use even after you quickstarted the
> project, like Rails generate scripts.
>
> I mean, tg-admin ATM helps you only at the beginning (app skeleton) but
> it would be nice to use it even for others commons tasks you have to do
> during development like:
> - a new controller
> - identity support
> - a new widget
> - a new template that extends your master.kid
> - a unit test for your controller
> - a template to customize a widget
> ...
>
> What do you think?

I agree with you, Michele. It would be really helpful. But too many options
is also bad... What I see is that tg-admin is "app wide". It shouldn't be
used to deal with widgets and customizing them, for example. Getting a new
controller, getting identity, helping with unit test (big +1 here!) is OK to
me.

For the other activities maybe a tg-extend or something like that.

--
Jorge Godoy <jgo...@gmail.com>

Leandro Lucarella

unread,
Jan 8, 2006, 3:57:47 PM1/8/06
to turbo...@googlegroups.com
Michele Cella, el domingo 8 de enero a las 20:47 me escribiste:

>
> +1
>
> A quickstarted project should be kept barely simple IHMO.
>
> What I would really like (more than an advanced option for tg-admin) is
> a set of command that you can use even after you quickstarted the
> project, like Rails generate scripts.
>
> I mean, tg-admin ATM helps you only at the beginning (app skeleton) but
> it would be nice to use it even for others commons tasks you have to do
> during development like:
> - a new controller
> - identity support
> - a new widget
> - a new template that extends your master.kid
> - a unit test for your controller
> - a template to customize a widget
> ...
>
> What do you think?

I think it could be very hard (and potentially danger) to modify a project
after it's created, and you have to use convention (as ruby does) or too
much configuration (so you can tell the code generating scripts where to
put the generating stuff). I think is much more easy to do this things in
the quickstart command, so you can start with a nice skeleton...

I mean, is not that I don't think is a good idea, but I think I could be
too much trouble compared to the benefits you get from it.

--
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
.------------------------------------------------------------------------,
\ GPG: 5F5A8D05 // F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05 /
'--------------------------------------------------------------------'

<muBarder> Y vos, Nw2o? A vos no te conozco pero debes ser flor de bala!
<Nw2o> hijo de un polvo callejero

David Stanek

unread,
Jan 8, 2006, 6:22:50 PM1/8/06
to turbo...@googlegroups.com
It is happening for someone in chat that was using MySQL.

-- David

Michele Cella

unread,
Jan 8, 2006, 7:32:24 PM1/8/06
to TurboGears
Jeff Watkins wrote:
> Are you running SQLite version 2 or 3? At least one other person saw
> these errors go away after moving from 2 to 3.
>

Thanks Jeff, problem solved after using SQLite3.

Some nitpicks:

Why the error with SQLite2?
On ubuntu (where pysqlite uses sqlite2) at least *everyone* that tries
tg will get this error, he should ask why, he should install a new
package, find it (it's named python-pysqlite2) and try again.
That's not a good first impression IMHO.

Now that visit is in you can't start your project if you don't make a
db, I think that's really annoying (1 more step). It seems that this
happens even after disabling it (but I'm sure that I'm probably doing
something wrong).

The log is full of
...
2006-01-09 01:21:29,265 turbogears.visit DEBUG sending updates...

You should use
raise turbogears.redirect("/")
or
turbogears.redirect("/")
instead of
raise cherrypy.HTTPRedirect(turbogears.url("/"))

There is whitespace incosticency betwenn your new code and the previous
(for example look at expose decorators). :P

Again I think we shouldn't put identity on a quickstarted project.
At first sight less is better and easy to learn, at least in my
opinion.
Moreover identity is not required by every user and when you quickstart
a project if you never used TG you start wondering what it's happening
inside login and logout with this big dict and cherrypy internals
exposed.

Anyway keep up the great work. ;-)

Ciao
Michele

Jeff Watkins

unread,
Jan 8, 2006, 9:22:29 PM1/8/06
to turbo...@googlegroups.com
On 8 Jan, 2006, at 7:32 pm, Michele Cella wrote:

> Why the error with SQLite2?
> On ubuntu (where pysqlite uses sqlite2) at least *everyone* that tries
> tg will get this error, he should ask why, he should install a new
> package, find it (it's named python-pysqlite2) and try again.
> That's not a good first impression IMHO.

I don't know what's causing the error. I'm using SQLObject as per the
documentation. Perhaps there's a bug in the SQLObject code with
regard to SQLite2 (although someone indicated some MySQL users were
seeing the same problem).

> Now that visit is in you can't start your project if you don't make a
> db, I think that's really annoying (1 more step). It seems that this
> happens even after disabling it (but I'm sure that I'm probably doing
> something wrong).

That seems weird. Naturally, if you have Visit tracking enabled and
you don't have a DB that's going to cause trouble, but if Visit
tracking is disabled, it shouldn't complain...

Ah. Found it. I create the table in the constructor for the
VisitFilter, which is before I check whether Visit Tracking is
enabled... I should fix that or trap the exception...

> The log is full of
> ...
> 2006-01-09 01:21:29,265 turbogears.visit DEBUG sending updates...

Removed. That was more for my testing purposes (I'd not used threads
with Python yet).

> Again I think we shouldn't put identity on a quickstarted project.
> At first sight less is better and easy to learn, at least in my
> opinion.
> Moreover identity is not required by every user and when you
> quickstart
> a project if you never used TG you start wondering what it's happening
> inside login and logout with this big dict and cherrypy internals
> exposed.

I disagree (obviously). Per a recent thread, adding support for
features after quickstart is problematic and basically too hard to do
right. So having all the goodies there is important.

On the otherhand, I agree that there's a lot of exposed nastiness
that can be improved. I was thinking of adding a controller to handle
login and logout which would hide most of the pipes and wires
currently exposed.

> You should use
> raise turbogears.redirect("/")
> or
> turbogears.redirect("/")

Cool. I remember seeing this bandied about, but didn't realise it was
in yet.

> Anyway keep up the great work. ;-)

Actually, one of the features I *CAN'T* add to TurboGears is
aggregated identity from multiple sources (DB, LDAP, IMAP, etc)
because it would be considered a Single Sign On solution and my
employer (an SSO provider) would own it. Not good.

"Computers are like Old Testament gods; lots of rules and no mercy."
-- Joseph Campbell


Jeff Watkins

unread,
Jan 8, 2006, 9:36:52 PM1/8/06
to turbo...@googlegroups.com
I just tried wrapping the createTable call (which happens outside any
requests and therefore isn't wrapped in a transaction) in a hub.begin
()/hub.commit() pair.

If someone is still having problems, could you try this latest code
(r485) and tell me if it helps? I'm just grasping at straws here...

On 8 Jan, 2006, at 9:22 pm, Jeff Watkins wrote:

> I don't know what's causing the error. I'm using SQLObject as per
> the documentation. Perhaps there's a bug in the SQLObject code with
> regard to SQLite2 (although someone indicated some MySQL users were
> seeing the same problem).

--
Jeff Watkins
http://newburyportion.com/

Computers, they're just a fad.


Jeremy Jones

unread,
Jan 8, 2006, 10:11:22 PM1/8/06
to turbo...@googlegroups.com
Jeff Watkins wrote:
> Actually, tg_user is the name of the table and TG_User is the name of
> the class. Per ticket #??? (Trac down again?) all the default Identity
> model classes are InheritableSQLObjects. This means they have an
> additional column 'child_name'.
>
> You can either drop the tables or alter them to have the child_name
> column (TEXT in SQLite).
>
> One of the nifty features of the latest Identity framework is that it
> will automatically create the necessary tables (like CatWalk) without
> you having to munge sqlobject.txt in your egg info.
>

So how is this supposed to work exactly? I've "from
turbogears.identity.soprovider import *" in my model.py file. I can
only get it to create the tg_* tables by modifying my sqlobject.txt file.

- jmj

Michele Cella

unread,
Jan 9, 2006, 5:09:32 AM1/9/06
to TurboGears
Jeff Watkins wrote:
>
> Actually, one of the features I *CAN'T* add to TurboGears is
> aggregated identity from multiple sources (DB, LDAP, IMAP, etc)
> because it would be considered a Single Sign On solution and my
> employer (an SSO provider) would own it. Not good.
>

Too bad. :-(

Ciao
Michele

Jeff Watkins

unread,
Jan 9, 2006, 6:59:31 AM1/9/06
to turbo...@googlegroups.com
It will create the tables when needed. So, when you start up, it should create all of the tg_* tables. They won't be created by tg-admin sql create.

That's how it's supposed to work.

On 8 Jan, 2006, at 10:11 pm, Jeremy Jones wrote:

So how is this supposed to work exactly?  I've "from turbogears.identity.soprovider import *" in my model.py file.  I can only get it to create the tg_* tables by modifying my sqlobject.txt file.


'I know about people who talk about suffering for the common good. It's never bloody them! When you hear a man shouting "Forward, brave comrades!" you'll see he's the one behind the bloody big rock and the one wearing the only really arrow-proof helmet!'

-- Rincewind gives a speech on politics. (Terry Pratchett, Interesting Times)



Reply all
Reply to author
Forward
0 new messages