Yes, I had the same thoughts. Wanted to send the least intrusive patch that fixes the problem though. There might be equal issues lurking with references to user. Didn't check those because, well, my user table is named user :)
Another thing I am wondering : the value of being able to specify the column name is, well, having some semblance of control over how the final SQL is laid out (for example because you need to play nice with an existing database?). But then Dbo goes and adds a silent "_id" anyway to what the user specifies. This negates that advantage. So now specifying the column name has become a strict burden with dubious gains. Then why not go ahead and provide a variant of the belongsTo/hasMany pair that doesn't take a name parameter at all and figures it out itself? Secondly, I am not a big fan of the hangman example for showing off Auth. My issue is that you typedef-fed types with exactly the same name as their Auth::Dbo class templates. Combined with using namespace Wt; above it is not always directly clear if a used name refers to the typedef within the example or the template class in the Wt code. Not as helpfull as it could be for an example. I would suggest dropping the use of using namespace Wt; in these examples and having all typedefs in example code that potentially have the same name as templates in the code be named as typedef Wt::Auth::Dbo::UserDatabase<AuthInfo> MyUserDatabase; Lastly, I am not 100% convinced on the names of things within Wt::Auth. Correct me if I have things wrong here. There is an AuthInfo which as far as I get is the single copy of authorative information used to identify a single user in the Auth systemn. There are AuthInfo::Identity which presents a way in which a client may prove they are really AuthInfo explicitly (login, OAuth). And then there are AuthTokens which are ways in which a client may prove they are really AuthInfo implicitly (cookies mainly). I would expect these names to be respectively Identity, Passport and Voucher. This way a user has a single Identity (as in real life), can have one or more Passports (as in real life) proving their identity and can have one more Vouchers which fullfill the same role but in a different way. Lastly, is there a reason why (using your naming here) an AuthToken cannot be just a kind of Identity from the standpoint of the program using the Wt::Auth library? At this point I am not seeing why I would care about that, except having a way to set the policy on AuthToken use (do/don't, expire/don't expire, name-of-cookie, ...) cu bart Op 30/11/2011 11:01, Koen Deforche schreef: > Hey, > > 2011/11/29 Bart Vanhauwaert<[email protected]>: >> Please apply. > > I will. This actually makes me realize that this is a shortcoming in > Dbo: you should be able to access the session from the action (which > most (all?) actions have anyway) to get the name of mapped tables, so > that we could write: > > Wt::Dbo::belongsTo(a, authInfo_, a.session().tableName<AuthInfoType>()); > > instead of > > Wt::Dbo::belongsTo(a, authInfo_, "auth_info"); > > Regards, > koen > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure > contains a definitive record of customers, application performance, > security threats, fraudulent activity, and more. Splunk takes this > data and makes sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-novd2d > _______________________________________________ > witty-interest mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/witty-interest > ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d _______________________________________________ witty-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/witty-interest
