Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions synapse/models/geospace.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,9 @@ def repr(self, norm):
('address', ('geo:address', {}), {
'doc': 'The postal address where the {title} {happened}.'}),

('address:city', ('base:name', {}), {
'doc': 'The city where the {title} {happened}.'}),

('latlong', ('geo:latlong', {}), {
'doc': 'The latlong where the {title} {happened}.'}),

Expand Down
2 changes: 2 additions & 0 deletions synapse/tests/test_model_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ async def test_model_entity(self):
:social:accounts={[ inet:service:account=({"name": "invisig0th"}) ]}
:birth:place:country:code=us
:death:place:country:code=zz
:place:address:city=" new York city "
]''')
self.len(1, nodes)
self.eq(nodes[0].get('name'), 'visi')
Expand All @@ -26,6 +27,7 @@ async def test_model_entity(self):
self.eq(nodes[0].get('websites'), ('https://vertex.link',))
self.eq(nodes[0].get('birth:place:country:code'), 'us')
self.eq(nodes[0].get('death:place:country:code'), 'zz')
self.eq(nodes[0].get('place:address:city'), 'new york city')
self.len(1, nodes[0].get('social:accounts'))
self.len(1, await core.nodes('entity:contact -> inet:service:account'))

Expand Down
2 changes: 2 additions & 0 deletions synapse/tests/test_model_geospace.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ async def test_types_forms(self):
:desc="The place where Vertex Project hangs out at!"
:name="Vertex HQ"
:address="208 Datong Road, Pudong District, Shanghai, China"
:address:city=" Shanghai "
:loc=us.hehe.haha
:photo=*
:latlong=(34.1341, -118.3215)
Expand All @@ -238,6 +239,7 @@ async def test_types_forms(self):
self.eq(node.get('altitude:accuracy'), 2000)
self.eq(node.get('desc'), 'The place where Vertex Project hangs out at!')
self.eq(node.get('address'), '208 datong road, pudong district, shanghai, china')
self.eq(node.get('address:city'), 'shanghai')
self.nn(node.get('photo'))

self.len(1, await core.nodes('geo:place :photo -> file:bytes'))
Expand Down