I have problem displaying the list of 'Contact' in DefaultView of Department.
I tried to get view of every Contact in Department
contact = aq_inner(contact)
oc_view = api.content.get_view('officecontact-view', contact, self.request)
but oc_view.w is None, so I can not use oc_view in template of Department
# getcontacts return the list of contacts as brains
def getgeojson(self):
contacts = self.getcontacts()
jd = {
"type": "FeatureCollection",
"features": []
}
for b in contacts:
bt = self.create_feature(
# here various data extracted from brain b, with latitude and longitude
)
jd['features'].append(bt)
return json.dumps(jd)
where create_feature returns:
bt = {
"type": "Feature",
"id": contactid,
"properties": {
"popup": popupContent, <- here you can have the popup html
"color": "a color",
"editable": False
},
"geometry": {
"type": "Point",
"coordinates": [
lg,
lt
]
}
}