IRC logs of #tryton for Friday, 2021-02-12

chat.freenode.net #tryton log beginning Fri Feb 12 12:00:01 AM CET 2021
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton00:02
-!- thaneor(~acer8@r167-57-95-147.dialup.adsl.anteldata.net.uy) has joined #tryton01:02
-!- thaneor(~acer8@r167-57-95-147.dialup.adsl.anteldata.net.uy) has joined #tryton02:02
-!- thaneor1(~ldlc6@r167-61-182-47.dialup.adsl.anteldata.net.uy) has joined #tryton02:02
-!- thaneor2(~acer8@r186-54-28-177.dialup.adsl.anteldata.net.uy) has joined #tryton04:02
-!- springwurm(~Springwur@5.104.149.54) has joined #tryton07:02
-!- mrichez(~Maxime@2a02:a03f:c2e8:f900:ed77:85ea:af2b:ba6e) has joined #tryton07:02
-!- rpit(~rpit@p200300c88f0235001c42215a17f33f55.dip0.t-ipconnect.de) has joined #tryton08:02
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton08:02
-!- mariomop(~quassel@181.29.189.235) has joined #tryton11:02
-!- udono(~udono@94.31.97.82) has joined #tryton13:02
-!- springwurm(~Springwur@5.104.149.54) has joined #tryton14:02
-!- thaneor(~ldlc6@r190-135-72-203.dialup.adsl.anteldata.net.uy) has joined #tryton15:02
-!- thaneor1(~acer8@r186-54-28-177.dialup.adsl.anteldata.net.uy) has joined #tryton15:02
-!- lucascastro(~lucascast@177-185-131-162.corp.isotelco.net.br) has joined #tryton15:02
mrichezhi, need some help with a route. It's a simple route returning active products: https://pastebin.com/LtgCmfpx15:02
mrichezgot a "TypeError: Expected bytes" on tryton server when calling route15:02
mrichezhere"s the log: https://pastebin.com/i4kR3xjC15:02
cedkmrichez: do you request json? because you return a list which is not an HTTP answer15:02
mrichezcedk: just doing requests.get15:02
cedkmrichez: you must set Content-Type: json if you want to receive json15:02
mrichezcedk: how to set Content-Type with tryton route ?15:02
-!- rpit(~rpit@p200300c88f0235001c42215a17f33f55.dip0.t-ipconnect.de) has joined #tryton15:02
-!- udono(~udono@94.31.97.82) has joined #tryton15:02
pokolimrichez: https://hg.tryton.org/trytond/file/bdea3f9af35f/trytond/protocols/wrappers.py#l21515:02
cedkmrichez: it is on the request header15:02
pokolimrichez: you should convert convert your object to sjson and set contect_type_attribute on the response15:02
mrichezOk, thanks both of you :-)15:02
cedkindeed if your route should always return json, it is probably better to return a Response with json dump15:02
mrichezcedk: thanks for advice15:02
-!- lucas_(~lucascast@177-185-131-162.corp.isotelco.net.br) has joined #tryton16:02
-!- thaneor1(~acer8@r167-57-62-132.dialup.adsl.anteldata.net.uy) has joined #tryton16:02
-!- lucascastro(~lucascast@177-185-133-183.dynamic.isotelco.net.br) has joined #tryton16:02
-!- fooflare(~fooflare@213.94.26.109) has joined #tryton16:02
-!- lucascastro(~lucascast@177-185-131-162.corp.isotelco.net.br) has joined #tryton19:02
-!- lucas_(~lucascast@177.51.23.122) has joined #tryton19:02
-!- lucascastro(~lucascast@177-185-131-162.corp.isotelco.net.br) has joined #tryton20:02
-!- fooflare(~fooflare@213.94.26.109) has joined #tryton20:02
-!- lucascastro(~lucascast@177-185-131-162.corp.isotelco.net.br) has joined #tryton20:02
-!- lucascastro(~lucascast@45-167-143-6.netfacil.inf.br) has joined #tryton20:02
-!- lucascastro(~lucascast@177-185-133-183.dynamic.isotelco.net.br) has joined #tryton21:02
-!- lucascastro(~lucascast@177-185-133-183.dynamic.isotelco.net.br) has joined #tryton21:02
-!- thaneor1(~acer8@r167-57-62-132.dialup.adsl.anteldata.net.uy) has joined #tryton22:02

Generated by irclog2html.py 2.16.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!