diff options
author | Sergey Tikhonov <zimbler@gmail.com> | 2015-02-12 17:33:55 +0300 |
---|---|---|
committer | Sergey Tikhonov <zimbler@gmail.com> | 2015-02-12 17:33:55 +0300 |
commit | 5d6b9be0bcabb09606076193ec1c2841700485c0 (patch) | |
tree | f281d5a2487de0edaf9e25e3894c1562a590681a /kombu/entity.py | |
parent | 9ff773aa68e56daa3ff1c03f29b623526d9109de (diff) | |
download | kombu-5d6b9be0bcabb09606076193ec1c2841700485c0.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 f7b294c2..9a12dd93 100644 --- a/kombu/entity.py +++ b/kombu/entity.py @@ -737,3 +737,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 + |