jueves, 26 de marzo de 2009

Creando usuarios programaticamente en Plone


from Products.CMFCore.utils import getToolByName
#Primero pedimos la portal_registration tool
pr = getToolByName(context, 'portal_registration')
id = 'id_usuario'
password = 'password'
#En este diccionario cargamos campos adicionales
props = {
'username' : id,
'fullname' : 'Nombre Completo',
'email' : 'email_del_usuario',
}

pr.addMember(id, password, properties=props)


API: http://api.plone.org/CMF/2.1.0/public/frames/products/CMFCore/products.CMFCore.MembershipTool.MembershipTool-class.html#addMember

2 comentarios:

Anónimo dijo...

These cover every potential type of theme, characteristic, and elegance. There is a devoted website for gamers in Asia you have got} many nice opportunities to get your hands on juicy bonus provides. If half in} on line casino video games, or more particularly slot video games, set your limit whether or not this 1xbet is on one or more of} video games.

Anónimo dijo...

Make certain you understand which of them feature the bonuses you’re after to make your game time thecasinosource.com more enjoyable. – These cater particularly to the casino’s massive stakes gamers, who place high-end bets and stay for high-end rewards. – This bonus lets you test the sport earlier than having to make use of any of your individual money.