[Zope] Re: Exporting portal member data to csv

Paul Williams pwilliams at diamonddata.com
Tue Feb 27 08:22:36 EST 2007


What does your log say?

Win Myint Aung wrote:
> When i run the external method in plone site, it shows errors.
>  
> The error shows.
>  
> 
> 
>     Site Error
> 
> An error was encountered while publishing this resource.
> 
> *Error Type: AttributeError*
> *Error Value: portal_memberdata*
> 
>  
> 
> The following is the codings used in external methon.
>  
>     # make heading row
>     row = makeRow()
>     row[0] = 'member_id'
>     row[1] = 'password'
>     writer.writerow(row)
>    
>     for member in self.portal_membership.listMembers():
>        
>         # make row for each member full of blank values
>         row = makeRow()
>         member_id = member.getId()
>         user = acl_users.getUser(name=member_id)
>         password = user._getPassword()
>         row[0] = member_id
>         row[1] = password
>         writer.writerow(row)
> 
>     request.RESPONSE.setHeader('Content-Type','application/csv')
>     request.RESPONSE.setHeader('Content-Length',len(text.getvalue()))
>     
> request.RESPONSE.setHeader('Content-Disposition','inline;filename=%smembers.csv' 
> %
>                                 
> time.strftime("%Y%m%d-%H%M%S-",time.localtime()))
>     return text.getvalue()
>  
>  
>  
> 
> ------------------------------------------------------------------------
> TV dinner still cooling?
> Check out "Tonight's Picks" 
> <http://us.rd.yahoo.com/evt=49979/*http://tv.yahoo.com/> on Yahoo! TV.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Zope-DB mailing list
> Zope-DB at zope.org
> http://mail.zope.org/mailman/listinfo/zope-db



More information about the Zope mailing list