Closed cecilulysess closed 4 years ago
Currently the logic recursively convert all relations. This will be undesirable in many cases.
How about change ProtoBufMixin's to_pb method from
def to_pb(self):
to
def to_pb(self, depth=None):
for example depth = 0 does not convert any relation, depth = 1 convert only direct relation etc.
Does this make sense? Happy to PR if owner agree on this feature.
great, but considering backward compatibility what value would be the default value ?
Oops, I missed None. So None would be the original flow, right?
Yes
link #20
Currently the logic recursively convert all relations. This will be undesirable in many cases.
How about change ProtoBufMixin's to_pb method from
def to_pb(self):
to
def to_pb(self, depth=None):
for example depth = 0 does not convert any relation, depth = 1 convert only direct relation etc.
Does this make sense? Happy to PR if owner agree on this feature.