2
A
回答
0
感謝您answer
其實,我在考慮使用ACL集團和引用機制,當我問這個問題的。 這將有助於權限和共享。
對於每個關係,爲每個用戶創建一組(用戶A的好友)
當創建用戶>
- 創建用戶組>
- 創建用戶之間的引用和組使用reference_catalog(我不知道如何或甚至可能)
- 添加新組localroles對用戶的文件夾(關係-角色映射可通過ControlPanel控制爲配置)
- 創建用戶組>
當創建關係 - >爲所有用戶創建新組(需要一定的時間,但會很少使用)
添加/刪除關係 - >添加/關聯組中刪除用戶
更新:看來,幾乎所有我需要的是通過實施包。
4
我建議使用annotations並創建多棵樹。對於前:
import BTrees
from zope import annotation
FOLLOWERS_KEY = "my.product.followers"
FOLLOWS_KEY = "my.product.follows"
FRIENDS_KEY = "my.product.friends"
portal = self.context.portal_url.getPortalObject()
annotations = annotation.interfaces.IAnnotations(portal)
if not annotations.get(FOLLOWERS_KEY, None):
annotations[FOLLOWERS_KEY] = BTrees.IIBTree.IITreeSet()
if not annotations.get(FOLLOWS_KEY, None):
annotations[FOLLOWS_KEY] = BTrees.IIBTree.IITreeSet()
if not annotations.get(FRIENDS_KEY, None):
annotations[FRIENDS_KEY] = BTrees.IIBTree.IITreeSet()
followers = annotation.get(FOLLOWERS_KEY)
follows = annotation.get(FOLLOWS_KEY)
friends = annotation.get(FRIENDS_KEY)
相關問題
- 1. 使用Biztalk的系統之間的首選通信方式
- 2. 升級到新的Plone主版本的首選方式是什麼?
- 3. 管理MonoTouch項目的OSS依賴關係的首選方式是什麼?
- 4. 在MonoTouch中調用REST服務的首選方式是什麼?
- 5. 設計一個與用戶之間的關係表的好方法是什麼?
- 6. 在Clojure中執行用戶認證和授權的首選方式是什麼?
- 7. 在Flex3中處理用戶首選項文件的方式是什麼?
- 8. 在echo中的變量之間添加空格的最佳方式是什麼?
- 9. twisted.cred.portal.IRealm,門戶和頭像之間的關係是什麼
- 10. 合作中間件的首選體系結構是什麼?
- 11. 什麼是選項`rlimit`和`timeout`之間的關係?
- 12. C++和Ruby之間的關係和依賴關係是什麼?
- 13. dup()和close()系統調用之間的關係是什麼?
- 14. 在SQL中返回空表的首選方式是什麼?
- 15. 在Python中處理數據的首選方式是什麼?
- 16. 什麼是在OpenGL中顯示大圖像的首選方式
- 17. 什麼是在Rails中生成HTML標籤的首選方式?
- 18. wpf模板樣式usercontroles之間的關係是什麼?
- 19. 註釋中註釋方法的首選方式是什麼?
- 20. 什麼是在Three.js中加載STL文件的首選方法
- 21. 將自定義數據添加到Wordpress主題的首選方式是什麼?
- 22. 將「無」類添加到分類器的首選方式是什麼?
- 23. 在JavaScript中Number和Function.prototype之間的關係是什麼?
- 24. Scala中的隱式轉換和隱式參數之間的關係是什麼?
- 25. 什麼是OS X中進程間通信的首選方法?
- 26. 什麼是官方「首選」的方式來安裝系統pip和virtualenv?
- 27. 在Ruby中使用助手方法的首選方式是什麼?
- 28. 記錄log4net使用的conversionPattern值的首選方式是什麼?
- 29. 什麼是關閉Python對象使用的psycopg2連接的首選方式?
- 30. 什麼是系統類和PrintStream類之間的關係
對於IIBTrees,假設您會使用整數鍵?這將如何映射到特定用戶(在索引的兩端)?我可能會建議使用OOBTree實例來代替IIBTree實例的註釋對象。我強烈建議使用('namespace','id')的元組作爲你的人類/用戶/主體標識符,例如:following = {('email','[email protected]'):[('member',' sdupton'),]。另外:請記住像「follow」這樣的關係是不對稱的(我遵循你,並不總是這樣);如果您需要另一個方向的索引('followed_by'),請添加一個索引。 – sdupton
是的,你是對的。 IIBTree只是一個例子,我的觀點是使用註釋。絕對OOBTrees更合適。 –