mirror of
https://github.com/solero/houdini.git
synced 2024-11-14 14:48:21 +00:00
Return 0 for penguin string attribute if attribute is None
This commit is contained in:
parent
c5d2b6e03b
commit
094ee97f4d
@ -44,13 +44,13 @@ class PenguinStringCompiler(OrderedDict):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def attribute_by_name(cls, attribute_name):
|
def attribute_by_name(cls, attribute_name):
|
||||||
async def attribute_method(p):
|
async def attribute_method(p):
|
||||||
return getattr(p, attribute_name)
|
return getattr(p, attribute_name) or 0
|
||||||
return attribute_method
|
return attribute_method
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def data_attribute_by_name(cls, attribute_name):
|
def data_attribute_by_name(cls, attribute_name):
|
||||||
async def attribute_method(p):
|
async def attribute_method(p):
|
||||||
return getattr(p.data, attribute_name)
|
return getattr(p.data, attribute_name) or 0
|
||||||
return attribute_method
|
return attribute_method
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
Loading…
Reference in New Issue
Block a user