I made it work.
Basically you declare a resource directory with:
config.add_static_view('static', 'static', cache_max_age=3600)
Then in the you set the icon attribute to /static/myicon.png
contentName.attrib["icon"] = "/static/edit.png"
And that's it!