Mercurial > libervia-web
comparison libervia/server/pages_tools.py @ 1302:04e7dd6b6f4d
pages (blog, tickets, merge-requests): updated code to handle new serialisation, following backend changes
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 16 Jul 2020 09:08:47 +0200 |
parents | f511f8fbbf8a |
children | 822bd0139769 |
comparison
equal
deleted
inserted
replaced
1301:ff44f822bfdd | 1302:04e7dd6b6f4d |
---|---|
17 # You should have received a copy of the GNU Affero General Public License | 17 # You should have received a copy of the GNU Affero General Public License |
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 | 19 |
20 """Helper methods for common operations on pages""" | 20 """Helper methods for common operations on pages""" |
21 | 21 |
22 from twisted.internet import defer | |
22 from sat.core.i18n import _ | 23 from sat.core.i18n import _ |
24 from sat.core.log import getLogger | |
25 from sat.tools.common import data_format | |
23 from libervia.server.constants import Const as C | 26 from libervia.server.constants import Const as C |
24 from twisted.internet import defer | 27 |
25 from sat.core.log import getLogger | |
26 | 28 |
27 log = getLogger(__name__) | 29 log = getLogger(__name__) |
28 from sat.tools.common import data_objects | |
29 | 30 |
30 | 31 |
31 def commentsDataToObjects(comments_data): | 32 def deserialise(comments_data_s): |
32 return data_objects.BlogItems(comments_data) | 33 return data_format.deserialise(comments_data_s) |
33 | 34 |
34 | 35 |
35 def retrieveComments(self, service, node, profile, pass_exceptions=True): | 36 def retrieveComments(self, service, node, profile, pass_exceptions=True): |
36 """Retrieve comments from server and convert them to data objects | 37 """Retrieve comments from server and convert them to data objects |
37 | 38 |
52 service=service, node=node, msg=e | 53 service=service, node=node, msg=e |
53 ) | 54 ) |
54 ) | 55 ) |
55 return defer.succeed([]) | 56 return defer.succeed([]) |
56 | 57 |
57 d.addCallback(commentsDataToObjects) | 58 d.addCallback(deserialise) |
58 return d | 59 return d |