Zope Plone 3.1.2 - 导出所有用户的电子邮件地址

发布于 2024-09-01 12:52:19 字数 532 浏览 5 评论 0原文

我已经运行 zope / plone 站点大约一年了 - 这似乎是启动和运行 CMS 的一种相当快的方法,而且它对此来说是一项很棒的工作 - 它正在运行 3.1.2 的 plone。我现在是一名 zope 或 plone 专家(事实上,我读得越多,我知道的就越少!),但我对 python 很熟练。

我尝试将用户导出为 xml - 它因 unicode / id 错误而失败。我尝试导出为 zexp 文件,但实际上无法找到如何读取此文件(我尝试过 import zope 等,但我不知道下一步该做什么!

我找到了运行列出所有用户的脚本,但这些是针对 zope2 的,老实说,我实际上不知道如何安装它们,

有人可以吗

1) 告诉我如何修复 id / unicode xml 导出错误?请告诉我我可以直接在网站上做什么? 或者 2)向我展示如何读取和 zope zexp 文件并执行一些简单的操作,例如将其放入字典中?

我不知道会有这么多人注册使用我的网站,现在我希望将电子邮件列表管理移至另一个系统 - 因此需要导出。

预先感谢,

理查德。

I have been running zope / plone site for about a year now - it seemed to be a pretty fast way of getting a CMS up and running and it's a great job for this - it's running 3.1.2 of plone. I am in now way a zope or plone expert (in fact the more I read about it - the less I know I know!) , but I am handy at python.

I have tried to export the users as xml - it fails with the unicode / id bug. I have tried export as a zexp file, but I can't actually find out how to read this file (I have tried import zope etc but I don't know what to do next !

I have found scripts that run listing all users, but these are for zope2 and, if I am honest, I wouldn't actually know how to install them anyway.

Can someone please either

1) tell me how to fix the id / unicode xml export bug? And please tell me in ways I can do directly on the site ?
or
2) show me how to read and zope zexp file and do something simple like put it into a dict ?

I didn't know so many people were going to sign up for using my site and now I wish to move the email list management to another system - hence the requirement for the export.

Thanks in advance,

Richard.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

江南月 2024-09-08 12:52:19

提取用户电子邮件地址的另一种方法:

  1. 转到 ZMI 中 Plone 站点的根目录。
  2. 添加“脚本(Python)”。
    1. 想出一个好的 ID,例如“export_email”。
    2. 点击“添加和编辑”。
    3. 将文本字段中的代码替换为下面列出的代码。
    4. 不要忘记保存您的更改。
  3. 转到“测试选项卡”。

脚本的代码:

for member in context.portal_membership.listMembers():
    print member.getProperty('email')
return printed

Another way of extracting the email addresses of the users:

  1. Go to the root of the Plone site in the ZMI.
  2. Add a "Script (Python)".
    1. Come up with a nice id e.g. "export_email".
    2. Click on "Add and edit".
    3. Replace the code in the text field with the code listed below.
    4. Don't forget to save your changes.
  3. Go to the "test tab".

The code for the script:

for member in context.portal_membership.listMembers():
    print member.getProperty('email')
return printed
一影成城 2024-09-08 12:52:19

好吧 - 无论如何,我都会在这里给出一个答案,以防万一其他人遇到这个问题。

这确实是一个作弊,但我编辑了 /portal_skins/custom/prefs_users_overview 并将下面的行从 :20 更改为 :2000,然后只做了一个简单的用户搜索,然后我 HTML 抓取了 mailto: 地址。

b_size 请求/b_size |蟒蛇:2000;

如果其他人发现这有用,请告诉我!

OK - I'm going to put an answer here anyway, just in case anybody else ever gets stuck with this issue.

It's a cheat really, but I edited the /portal_skins/custom/prefs_users_overview and changed the line below from :20 to :2000 and then just did a simple user search, and then I HTML scraped the mailto: addresses.

b_size request/b_size | python:2000;

If anybody else finds this useful, let me know !

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文