pyams-table 1.0.0__py3.5.egg

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. EGG-INFO/PKG-INFO +55 -0
  2. EGG-INFO/SOURCES.txt +32 -0
  3. EGG-INFO/dependency_links.txt +1 -0
  4. EGG-INFO/namespace_packages.txt +1 -0
  5. EGG-INFO/not-zip-safe +1 -0
  6. EGG-INFO/requires.txt +14 -0
  7. EGG-INFO/top_level.txt +1 -0
  8. pyams_table/__init__.py +29 -0
  9. pyams_table/__pycache__/__init__.cpython-35.pyc +0 -0
  10. pyams_table/__pycache__/batch.cpython-35.pyc +0 -0
  11. pyams_table/__pycache__/column.cpython-35.pyc +0 -0
  12. pyams_table/__pycache__/header.cpython-35.pyc +0 -0
  13. pyams_table/__pycache__/include.cpython-35.pyc +0 -0
  14. pyams_table/__pycache__/interfaces.cpython-35.pyc +0 -0
  15. pyams_table/__pycache__/table.cpython-35.pyc +0 -0
  16. pyams_table/__pycache__/testing.cpython-35.pyc +0 -0
  17. pyams_table/__pycache__/value.cpython-35.pyc +0 -0
  18. pyams_table/batch.py +159 -0
  19. pyams_table/column.py +495 -0
  20. pyams_table/doctests/README.rst +668 -0
  21. pyams_table/doctests/batch.rst +660 -0
  22. pyams_table/doctests/column.rst +1274 -0
  23. pyams_table/doctests/miscellaneous.rst +123 -0
  24. pyams_table/doctests/sequence.rst +267 -0
  25. pyams_table/doctests/sort.rst +388 -0
  26. pyams_table/header.py +102 -0
  27. pyams_table/include.py +27 -0
  28. pyams_table/interfaces.py +249 -0
  29. pyams_table/locales/fr/LC_MESSAGES/pyams_table.mo +0 -0
  30. pyams_table/locales/fr/LC_MESSAGES/pyams_table.po +40 -0
  31. pyams_table/locales/pyams_table.pot +41 -0
  32. pyams_table/table.py +383 -0
  33. pyams_table/testing.py +129 -0
  34. pyams_table/tests/__init__.py +29 -0
  35. pyams_table/tests/__pycache__/__init__.cpython-35.pyc +0 -0
  36. pyams_table/tests/__pycache__/test_utilsdocs.cpython-35.pyc +0 -0
  37. pyams_table/tests/__pycache__/test_utilsdocstrings.cpython-35.pyc +0 -0
  38. pyams_table/tests/test_utilsdocs.py +60 -0
  39. pyams_table/tests/test_utilsdocstrings.py +65 -0
  40. pyams_table/value.py +51 -0
pyams_table/value.py ADDED
@@ -0,0 +1,51 @@
1
+ #
2
+ # Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
3
+ # All Rights Reserved.
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
+ """PyAMS_table.value module
14
+
15
+ This module provides several default values adapters.
16
+ """
17
+
18
+ from pyramid.interfaces import IRequest
19
+ from zope.container.interfaces import IContainer
20
+ from zope.interface import Interface, implementer
21
+
22
+ from pyams_table.interfaces import ISequenceTable, ITable, IValues
23
+ from pyams_utils.adapter import ContextRequestViewAdapter, adapter_config
24
+
25
+
26
+ __docformat__ = "reStructuredText"
27
+
28
+
29
+ @implementer(IValues)
30
+ class ValuesMixin(ContextRequestViewAdapter):
31
+ """Mixin for different value adapters"""
32
+
33
+
34
+ @adapter_config(context=(IContainer, IRequest, ITable), provides=IValues)
35
+ class ValuesForContainer(ValuesMixin):
36
+ """Values adapter from a simple IContainer"""
37
+
38
+ @property
39
+ def values(self):
40
+ """Get container values"""
41
+ return self.context.values()
42
+
43
+
44
+ @adapter_config(context=(Interface, IRequest, ISequenceTable), provides=IValues)
45
+ class ValuesForSequence(ValuesMixin):
46
+ """Values adapter from a simple sequence table"""
47
+
48
+ @property
49
+ def values(self):
50
+ """Get sequence values"""
51
+ return self.context