On Thu, 2011-10-20 at 09:51 -0700, Francisco Costa wrote: 
> Hi,
> we are in the process of converting our MySQL DB to MongoDB (via
> pymongo).
> 
> We have already convert the auth_user table.
> Now we want to change the auth connection from
> auth = Auth(globals(), db)
> to
> auth = Auth(globals(), mongo)
> 
> but we get this error:
> TypeError: 'Collection' object is not callable. If you meant to call
> the 'Table' method on a 'Database' object it is failing because no
> such method exists.
> 
> Is there any way that the auth supports Collections and not only
> tables?

You will be able to do that using DAL with the mongodb adapter (once it
is finished); you get that error since Auth() expects a DAL object as
the second argument to constructor, in order to access the database;
instead, you are passing a pymongo.Collection object that Auth doesn't
know how to use..

For now, the two solutions I see are:
- temporarily use a sqlite database just to store users/auth stuff
- write a custom (maybe inheriting) "MongoAuth" object that acts like
Auth but uses mongodb collections to store data

-- 
Samuele ~redShadow~ Santi
----------------------------------------------------------------
     redshadow[at]hackzine.org - redshadowhack[at]gmail.com

  Blog: http://hackzine.org

  GPG Key signature:
       050D 3E9F 6E0B 44CE C008 D1FC 166C 3C7E EB26 4933
----------------------------------------------------------------
/me recommends:
    Squadra Informatica - http://www.squadrainformatica.com
----------------------------------------------------------------
 - Proud ThinkPad T-Series owner
 - Registered Linux-User: #440008
      * GENTOO User since 1199142000 (2008-01-01)
      * former DEBIAN SID user
----------------------------------------------------------------
      "Software is like sex: it's better when it's free!"
                              -- Linus Torvalds

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to