These are chat archives for ipython/ipython

27th
Sep 2017
Andrew Kirilenko
@iced
Sep 27 2017 12:12
say I have some object x which got list of IPython.display.Javascript()s inside. I want to type x in jupyter and have all these nested objects displayed. tried implementing __repr__() and _repr_javascript_ - no luck. if I type x.jss[0] - all ok and displayed as it should
jldiaz
@jldiaz_twitter
Sep 27 2017 15:30
@iced try with _repr_html_
eg. this works:
class JSContainer:
    def __init__(self):
        self.jss= []
        self.jss.append(IPython.display.Javascript(data='alert("Foo")'))
        self.jss.append(IPython.display.Javascript(data='alert("Bar")'))
    def _repr_html_(self):
        for j in self.jss:
            IPython.display.display(j)
x =JSContainer()
x
sachi842
@sachi842
Sep 27 2017 19:37
hello
has anyone worked with odoo?