Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

interfaces.py 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. ##############################################################################
  2. #
  3. # Copyright (c) 2005 Zope Foundation and Contributors.
  4. #
  5. # This software is subject to the provisions of the Zope Public License,
  6. # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
  7. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
  8. # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  9. # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
  10. # FOR A PARTICULAR PURPOSE.
  11. #
  12. ##############################################################################
  13. """Acquisition z3 interfaces.
  14. $Id$
  15. """
  16. from zope.interface import Attribute
  17. from zope.interface import Interface
  18. class IAcquirer(Interface):
  19. """Acquire attributes from containers.
  20. """
  21. def __of__(context):
  22. """Get the object in a context.
  23. """
  24. class IAcquisitionWrapper(Interface):
  25. """Wrapper object for acquisition.
  26. """
  27. def aq_acquire(name, filter=None, extra=None, explicit=True, default=0,
  28. containment=0):
  29. """Get an attribute, acquiring it if necessary.
  30. """
  31. def aq_inContextOf(obj, inner=1):
  32. """Test whether the object is currently in the context of the argument.
  33. """
  34. aq_base = Attribute(
  35. """Get the object unwrapped.""")
  36. aq_parent = Attribute(
  37. """Get the parent of an object.""")
  38. aq_self = Attribute(
  39. """Get the object with the outermost wrapper removed.""")
  40. aq_inner = Attribute(
  41. """Get the object with all but the innermost wrapper removed.""")
  42. aq_chain = Attribute(
  43. """Get a list of objects in the acquisition environment.""")
  44. aq_explicit = Attribute(
  45. """Get the object with an explicit acquisition wrapper.""")