IRC logs of #tryton for Saturday, 2010-03-06

chat.freenode.net #tryton log beginning Sat Mar 6 00:00:02 CET 2010
2010-03-06 00:21 <cedk> sharoon: hi
2010-03-06 00:22 <sharoon> cedk: hi
2010-03-06 00:22 <cedk> sharoon: have you started to work on a django frontend?
2010-03-06 00:22 <sharoon> cedk: frontend?
2010-03-06 00:22 <cedk> sharoon: webclient
2010-03-06 00:22 <sharoon> cedk: no
2010-03-06 00:22 <sharoon> cedk: django web client?
2010-03-06 00:22 <cedk> sharoon: yes, you told me you had this idea?
2010-03-06 00:23 <sharoon> cedk: oh thats already implemented
2010-03-06 00:23 <cedk> sharoon: I was thinking about for the GSOC
2010-03-06 00:23 <cedk> sharoon: is the code available?
2010-03-06 00:23 <sharoon> cedk: on personal chat
2010-03-06 00:25 -!- tekknokrat(~gthielebe@83.52.158.66) has left #tryton
2010-03-06 02:16 -!- rednul_(~rednul@host-98-127-6-7.bln-mt.client.bresnan.net) has joined #tryton
2010-03-06 03:03 -!- sharoon(~sharoonth@opg066b.halls.manchester.ac.uk) has left #tryton
2010-03-06 03:53 -!- johbo(~joh@statdsl-085-016-072-173.ewe-ip-backbone.de) has joined #tryton
2010-03-06 04:44 -!- digitalsatori(~tony@116.233.249.118) has joined #tryton
2010-03-06 05:19 -!- yangoon(~mathiasb@p549F61EC.dip.t-dialin.net) has joined #tryton
2010-03-06 05:25 -!- pepeu(~manuel@201.152.98.188) has joined #tryton
2010-03-06 07:15 -!- tekoholic(~quassel@67.217.14.90) has joined #tryton
2010-03-06 08:18 -!- johbo(~joh@statdsl-085-016-072-173.ewe-ip-backbone.de) has joined #tryton
2010-03-06 09:01 -!- sharkcz(~dan@plz1-v-4-17.static.adsl.vol.cz) has joined #tryton
2010-03-06 09:43 -!- carlos(~carlos@213.172.47.3) has joined #tryton
2010-03-06 09:54 -!- cedk(~ced@gentoo/developer/cedk) has joined #tryton
2010-03-06 10:00 -!- enlightx(~enlightx@host-78-13-116-22.cust-adsl.tiscali.it) has joined #tryton
2010-03-06 10:02 -!- sharoon(~sharoonth@opg066b.halls.manchester.ac.uk) has joined #tryton
2010-03-06 10:26 -!- tekknokrat(~gthielebe@95.214.35.160) has joined #tryton
2010-03-06 10:29 -!- Gavin_Achado(~Gavin_Ach@110-175-179-141.tpgi.com.au) has joined #tryton
2010-03-06 10:55 -!- Timitos(~timitos@88.217.184.172) has joined #tryton
2010-03-06 11:42 -!- digitalsatori(~tony@116.233.249.118) has joined #tryton
2010-03-06 12:12 -!- tekknokrat(~gthielebe@83.52.158.66) has joined #tryton
2010-03-06 13:01 <cedk> sharoon: hi
2010-03-06 13:01 <cedk> sharoon: I read the wiki page about django and I have some questions
2010-03-06 13:01 <sharoon> cedk: sure
2010-03-06 13:01 <cedk> sharoon: I see you commit the cursor in place where there was no change
2010-03-06 13:02 <cedk> sharoon: so you could simply close it
2010-03-06 13:02 <sharoon> cedk: checking
2010-03-06 13:02 <sharoon> cedk: agree
2010-03-06 13:02 <sharoon> cedk: i will change it
2010-03-06 13:03 <cedk> sharoon: other point, you make a invoice_obj.read or you already have a BrowseRecord of the invoice
2010-03-06 13:04 <cedk> sharoon: I don't see where you use "currency_id_TO"
2010-03-06 13:05 <sharoon> cedk: i have removed some part of the code which is used by our paypal integration
2010-03-06 13:05 <sharoon> cedk: forgot to remove this part
2010-03-06 13:07 <cedk> sharoon: you could also remove: "import cProfile as profile" "import threading" "import tempfile"
2010-03-06 13:08 <cedk> sharoon: and now, I design comment:
2010-03-06 13:09 <cedk> sharoon: I find a little bit uggly to store the invoice odt in /tmp
2010-03-06 13:09 <cedk> sharoon: you can not create a dowload function that return on the fly the document?
2010-03-06 13:11 <sharoon> cedk: that was the way its coded, but errs out when behind apache
2010-03-06 13:13 <cedk> sharoon: which kind of error?
2010-03-06 13:14 <sharoon> cedk: wsgi, so it should essentially do : http://www.djangosnippets.org/snippets/365/!
2010-03-06 13:16 <cedk> sharoon: yes and instead of using a file on the system, you could use in IOString
2010-03-06 13:17 <sharoon> cedk: thought it would be too complex for a simple tutorial integrating django and tryton
2010-03-06 13:18 <sharoon> cedk: agree,
2010-03-06 13:23 <cedk> sharoon: using tmp directory could be a security issue
2010-03-06 13:24 <sharoon> cedk: sure in this case
2010-03-06 13:24 <sharoon> cedk: it would be freely available for download of all invoices geenrates
2010-03-06 13:24 <cedk> sharoon: so I think we should try to show best practice even if it is a little bit more complicate
2010-03-06 13:24 <cedk> sharoon: is it the case of your implementation?
2010-03-06 13:24 <sharoon> cedk: nope
2010-03-06 13:25 <sharoon> cedk: we use it for the open erp modules download section
2010-03-06 13:25 <sharoon> cedk: and other dynamically served protectionless data
2010-03-06 13:25 <sharoon> cedk: when dynamically generated files need security the snippet i sent is what is commonly used
2010-03-06 13:28 <cedk> sharoon: it assumes also that the webserver is not chrooted etc.
2010-03-06 13:29 <sharoon> cedk: i agree and it has to be set as a virual directory under httpd.conf in apache
2010-03-06 13:29 <cedk> sharoon: if you have code for the dynamic download, you could update the wiki page?
2010-03-06 13:30 <sharoon> cedk: will do it now
2010-03-06 13:34 <cedk> sharoon: great thx
2010-03-06 13:38 -!- dba(~daniel@static.88-198-196-34.clients.your-server.de) has joined #tryton
2010-03-06 13:44 <cedk> sharoon: one more question:
2010-03-06 13:44 <sharoon> cedk: sure
2010-03-06 13:44 <cedk> sharoon: do you think it is possible to generate the html template on the fly by reading the xml view of Tryton?
2010-03-06 13:45 <sharoon> cedk: i think its possible
2010-03-06 13:46 <cedk> sharoon: ok I will put this idea for the GSOC
2010-03-06 13:46 <sharoon> cedk: cool
2010-03-06 13:46 -!- woakas(~woakas@devel.invytec.com) has joined #tryton
2010-03-06 13:47 <cedk> sharoon: wait, we are not yet selected for GSOC :-)
2010-03-06 13:52 <sharoon> cedk: looks like i could apply too... i am doing my MS in Information Systems... so a student?
2010-03-06 13:53 <cedk> sharoon: you should check with Google
2010-03-06 13:53 <cedk> sharoon: we apply as an organisation to mentor students
2010-03-06 13:53 <sharoon> cedk: i know
2010-03-06 13:53 <cedk> sharoon: we = Tryton devs
2010-03-06 13:54 <cedk> sharoon: http://socghop.appspot.com/document/show/gsoc_program/google/gsoc2010/faqs#student_apply
2010-03-06 14:03 <cedk> sharoon: but I think you can not apply as student if you are also a mentor
2010-03-06 14:08 <sharoon> cedk: i am nearly done with my topic of dissertation, waiting for school to approve... its in e-commerce
2010-03-06 14:25 <cedk> sharoon: sorry one more remark for django invoice module
2010-03-06 14:25 <sharoon> cedk: please, tell me
2010-03-06 14:25 <cedk> sharoon: you call print_invoice but it can break stuff as it will store the invoice report on the invoice even if the invoice is still in draft format
2010-03-06 14:26 <cedk> sharoon: you should call the invoice report instead that take care of this for you
2010-03-06 14:26 <sharoon> cedk: ok
2010-03-06 14:26 <sharoon> cedk: can you modify accordingly?
2010-03-06 14:26 <cedk> sharoon: ok
2010-03-06 14:32 -!- digitalsatori(~tony@116.233.249.118) has joined #tryton
2010-03-06 14:33 <cedk> sharoon: done
2010-03-06 14:33 <sharoon> cedk: thanks, checking
2010-03-06 14:33 <cedk> sharoon: is it required to use tempfile?
2010-03-06 14:34 <cedk> sharoon: you can not use IOString?
2010-03-06 14:34 <sharoon> cedk: its better
2010-03-06 14:34 <sharoon> cedk: i had several issues while serving open erp modules dynamically
2010-03-06 14:34 <cedk> sharoon: I mean StringIO
2010-03-06 14:35 <sharoon> cedk: thats what is normally done with django and report lab
2010-03-06 14:35 <sharoon> cedk: V
2010-03-06 14:35 <sharoon> cedk: http://docs.djangoproject.com/en/dev/howto/outputting-pdf/#complex-pdfs
2010-03-06 14:37 <sharoon> cedk: it could be also because i work on the trunk version of django ;) string IO is another alternative and faster since its c
2010-03-06 14:39 <cedk> sharoon: update the code with StringIO
2010-03-06 14:39 <cedk> sharoon: it is more secure
2010-03-06 14:39 <sharoon> cedk: ok
2010-03-06 14:42 <cedk> sharoon: there is still now a possible improvment for content_type
2010-03-06 14:43 <sharoon> cedk: depending on the file format it could be changed
2010-03-06 14:50 <cedk> sharoon: content type fixed
2010-03-06 14:53 <sharoon> cedk: cool
2010-03-06 14:56 <cedk> sharoon: if you can test the code it will be great
2010-03-06 15:01 -!- gremly(~gremly@78.220.60.190.host.ifxnetworks.com) has joined #tryton
2010-03-06 15:07 <sharoon> cedk: format, report, _, file_name = invoice_obj.execute(cursor, user, [inv_id], {}) is not working
2010-03-06 15:11 <cedk> sharoon: what is the problem?
2010-03-06 15:12 <sharoon> cedk: return value is format="id", report=None, _=None, file_name=None
2010-03-06 15:12 <cedk> sharoon: strange
2010-03-06 15:14 <cedk> sharoon: are you sure you get the report object?
2010-03-06 15:18 <cedk> sharoon: fixed
2010-03-06 15:47 <sharoon> cedk: still not fixed
2010-03-06 15:49 <cedk> sharoon: where is it failed?
2010-03-06 15:49 <sharoon> cedk: will let you know
2010-03-06 16:08 -!- digitalsatori(~tony@116.233.249.118) has joined #tryton
2010-03-06 16:17 -!- juanfer(~juanfer@78.220.60.190.host.ifxnetworks.com) has joined #tryton
2010-03-06 16:31 -!- carlos(~carlos@213.172.47.3) has joined #tryton
2010-03-06 16:36 -!- FWiesing(~FWiesing@194-208-185-012.tele.net) has joined #tryton
2010-03-06 16:56 <cedk> sharoon: no news?
2010-03-06 17:08 -!- tekknokrat(~gthielebe@83.52.158.66) has joined #tryton
2010-03-06 17:10 -!- paepke(~paepke@p5B32DA22.dip.t-dialin.net) has joined #tryton
2010-03-06 17:13 <sharoon> cedk: no issues
2010-03-06 17:13 <sharoon> its right
2010-03-06 17:13 <sharoon> cedk: file_name should be + format
2010-03-06 17:14 <sharoon> "." + format
2010-03-06 17:14 <sharoon> cedk: also StringIO.StringIO(data) doesnt seem to work
2010-03-06 17:14 <cedk> sharoon: not sure to understand
2010-03-06 17:14 <sharoon> cedk: had to initialise and then write data separately
2010-03-06 17:15 <sharoon> cedk: BTW i use ctringIO
2010-03-06 17:15 <sharoon> probalbly because fo that
2010-03-06 17:15 <sharoon> cedk: the file_name is now just Invoice, it has to be file_name+"."+format
2010-03-06 17:16 <sharoon> rather "%s.%s" %(file_name,format)
2010-03-06 17:16 <cedk> sharoon: ok
2010-03-06 17:18 <cedk> sharoon: it is all?
2010-03-06 17:18 <sharoon> yep
2010-03-06 17:18 <sharoon> thats all
2010-03-06 17:23 <cedk> sharoon: fixed on wiki
2010-03-06 17:23 <sharoon> cedk: cool
2010-03-06 17:24 <sharoon> cedk: 1 more
2010-03-06 17:24 <sharoon> reportIO = StringIO.StringIO() is not the format
2010-03-06 17:24 <sharoon> reportIO = StringIO()
2010-03-06 17:26 <cedk> sharoon: no StringIO is the module
2010-03-06 17:26 <sharoon> >>> import cStringIO
2010-03-06 17:26 <sharoon> >>> dir(cStringIO)
2010-03-06 17:26 <sharoon> ['InputType', 'OutputType', 'StringIO', '__doc__', '__name__', '__package__', 'cStringIO_CAPI']
2010-03-06 17:26 <sharoon> >>> dir(cStringIO.StringIO)
2010-03-06 17:26 <sharoon> ['__call__', '__class__', '__cmp__', '__delattr__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__name__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__self__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']
2010-03-06 17:26 <sharoon> >>>
2010-03-06 17:27 <cedk> sharoon: but not for StringIO
2010-03-06 17:27 <sharoon> cedk: so the import should be modified for stringIO as `from StringIO import StringIO
2010-03-06 17:27 <sharoon> and reportIO = StringIO()
2010-03-06 17:28 <cedk> sharoon: it is the same
2010-03-06 17:28 <sharoon> cedk: got it
2010-03-06 17:29 <sharoon> cedk: my bad.... dint read property
2010-03-06 17:29 <sharoon> propoerly
2010-03-06 17:57 <cedk> sharoon: I have made some improvement to the code
2010-03-06 17:57 <cedk> sharoon: I found that the cursor could be closed too early
2010-03-06 17:57 <sharoon> cedk: yes
2010-03-06 17:58 <cedk> sharoon: is "render_to_response" process the rendering ? Or it is a object that is render later?
2010-03-06 17:59 <sharoon> cedk: render_to_reponse renders a template in the given context and returns a httresponse
2010-03-06 18:00 <cedk> sharoon: ok so after this call, the BrowseRecord will no more be used
2010-03-06 18:01 <sharoon> cedk: yes
2010-03-06 18:01 <sharoon> cedk: its used
2010-03-06 18:01 <sharoon> cedk: its used in the template
2010-03-06 18:03 <cedk> sharoon: ok because in your implementation the cursor is closed before rendering
2010-03-06 18:03 <sharoon> cedk: looks like we replaced it today
2010-03-06 18:03 <sharoon> cedk: its only a cursor commit
2010-03-06 18:03 <cedk> sharoon: so if the template require to make a database query to fetch more data, it will fail
2010-03-06 18:04 <cedk> sharoon: and what is "c = get_context(request, response)"
2010-03-06 18:04 <cedk> sharoon: and "c.update(csrf(request))"
2010-03-06 18:04 <cedk> ?
2010-03-06 18:04 <sharoon> cedk: special functions
2010-03-06 18:05 <sharoon> csrf is cross site reference protection
2010-03-06 18:05 <sharoon> lookslike the code snippets needs to be cleaned up and the import be included
2010-03-06 18:09 <sharoon> cedk: fixed
2010-03-06 18:11 <cedk> sharoon: you changed "from controllers.tryton", why?
2010-03-06 18:11 <sharoon> cedk: controllers is a different app
2010-03-06 18:11 <cedk> sharoon: ok, there is still one, I will remove it
2010-03-06 18:11 <sharoon> cedk: here i assume that the tryton.py is in same folder
2010-03-06 18:13 <cedk> sharoon: is there a specific directory strucure for all that files?
2010-03-06 18:14 <sharoon> cedk: yes, all this usually goes into a single app
2010-03-06 18:14 <sharoon> cedk: and the html into a templates folder which further striuctures accordning to app
2010-03-06 18:14 <sharoon> cedk: when we say view, it goes into views.py of an app
2010-03-06 18:15 <cedk> sharoon: is it possible to give the filename of all the codes?
2010-03-06 18:15 <sharoon> cedk: good idea
2010-03-06 18:15 <sharoon> will do on top
2010-03-06 18:16 <cedk> sharoon: good like a tree structure
2010-03-06 18:16 <cedk> sharoon: because I don't know django and I don't see well how all this code is organized
2010-03-06 18:22 -!- enlightx(~enlightx@host-78-13-116-22.cust-adsl.tiscali.it) has joined #tryton
2010-03-06 18:29 <sharoon> cedk: done
2010-03-06 18:35 <cedk> sharoon: great
2010-03-06 20:19 -!- ikks(igor@186.97.19.57) has joined #tryton
2010-03-06 20:29 <cedk> sharoon: thx for the email
2010-03-06 20:29 <sharoon> :)
2010-03-06 20:30 <cedk> sharoon: I will try to answer and give their my vision and how tax include of OpenERP can not work
2010-03-06 20:33 <cedk> sharoon: a reflection that I had 4 ago when I worked at Tiny :-)
2010-03-06 20:37 -!- carlos(~carlos@247.156.221.87.dynamic.jazztel.es) has joined #tryton
2010-03-06 21:43 -!- tekknokrat(~gthielebe@95.214.83.207) has joined #tryton
2010-03-06 21:46 -!- rednul_(~rednul@host-98-127-38-178.bln-mt.client.bresnan.net) has joined #tryton
2010-03-06 22:04 -!- Franz_(~FWiesing@194-208-185-012.tele.net) has joined #tryton
2010-03-06 22:35 -!- FWiesing(~FWiesing@194-208-185-012.tele.net) has joined #tryton
2010-03-06 22:36 -!- FWiesing(~FWiesing@194-208-185-012.tele.net) has left #tryton
2010-03-06 22:37 -!- FWiesing(~FWiesing@194-208-185-012.tele.net) has joined #tryton
2010-03-06 23:24 -!- Gavin_Achado(~Gavin_Ach@110-175-179-141.tpgi.com.au) has joined #tryton

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