diff options
author | Sergey Tikhonov <zimbler@gmail.com> | 2015-02-12 17:33:55 +0300 |
---|---|---|
committer | Ask Solem <ask@celeryproject.org> | 2015-02-12 21:25:07 +0000 |
commit | fb24ea5f53f685b8df8e14f77c4388ada06041f0 (patch) | |
tree | 37442a13e3f75795675659ac552376bd5b4f7c9b /kombu/entity.py | |
parent | 846179c19d7bc7f86bb99e3704e315e67f74c01d (diff) | |
download | kombu-fb24ea5f53f685b8df8e14f77c4388ada06041f0.tar.gz |
#453 remove recursion and add separate bindings handling for as_dict(recurse=True)
Diffstat (limited to 'kombu/entity.py')
-rw-r--r-- | kombu/entity.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/kombu/entity.py b/kombu/entity.py index e0ea035e..87486070 100644 --- a/kombu/entity.py +++ b/kombu/entity.py @@ -730,3 +730,13 @@ class Queue(MaybeChannelBound): queue_arguments=q_arguments, binding_arguments=b_arguments, bindings=bindings) + + def as_dict(self, recurse=False): + res = super(Queue, self).as_dict(recurse) + if not recurse: + return res + bindings = res.get('bindings') + if bindings: + res['bindings'] = [b.as_dict(recurse=True) for b in bindings] + return res + |