IRC logs of #tryton for Monday, 2012-07-02

chat.freenode.net #tryton log beginning Mon Jul 2 00:00:01 CEST 2012
2012-07-02 09:34 <Ariadne> hi! i have a issue with tryton and need some help, plz! :)
2012-07-02 09:36 <nicoe> Ariadne: Don't ask to ask ... just ask ;)
2012-07-02 16:30 <__efx__> Hi there, I would like to understand why the installation of modules takes usually a while. What is the main limiting step ?
2012-07-02 16:36 <bechamel`> __efx__: the slowest module to install is country, because it contains a lot of data
2012-07-02 16:39 <__efx__> bechamel: ok I understand now, is this also the reason why an "empty" database (I mean with only modules installed but no other information) is already 20 Mb
2012-07-02 16:44 <__efx__> bechamel : sorry, that is not true
2012-07-02 16:47 <bechamel`> __efx__: I think an empty db is around 2Mb
2012-07-02 16:50 <__efx__> bechamel: It makes more sence
2012-07-02 17:29 <__efx__> I have a question concerning proteus. I select all the currencies using the find method with no parameter then I loop on the result and show the name of the currency. My problem is that the process is slow as if proteus was doing one select per entry how can I avoid that ?
2012-07-02 18:11 <__efx__> ..or maybe I did something in the wrong way
2012-07-02 18:12 <__efx__> no proteus expert around there ?
2012-07-02 18:13 <bechamel`> __efx__: it depends on your definition of expert :)
2012-07-02 18:15 <nicoe> __efx__: can you post your code somewhere ?
2012-07-02 18:15 <__efx__> bechamel : :) ok let say I use this definition of expert : somebody who has tried to do something like : for currency in currencies : print currency.name using a xmlrpc connection to a tryton server
2012-07-02 18:17 <__efx__> Actually I have nowhere to post.. maybe here.. my code is a 4 line code
2012-07-02 18:17 <__efx__> 1: from proteus import config, Model, Wizard
2012-07-02 18:17 <__efx__> 2: config.set_xmlrpc('http://'+user+':'+password+'@'+server+':'+port+'/'+database)
2012-07-02 18:18 <__efx__> 3 : Currency = Model.get('currency.currency')
2012-07-02 18:18 <__efx__> 4: currencies = Currency.find()
2012-07-02 18:18 <__efx__> 5: for currency in currencies :
2012-07-02 18:18 <__efx__> 6: print currency.name
2012-07-02 18:18 <__efx__> that's it
2012-07-02 18:19 <bechamel`> __efx__: what's the problem ?
2012-07-02 18:20 <__efx__> bechamel: it takes more than 1 minutes to print all the name
2012-07-02 18:20 <__efx__> bechamel: I don't expect xmlrpc to be fast but 1 minutes is a lot
2012-07-02 18:22 <nicoe> I have never tried proteus over xmlrpc but I think that sharoon did
2012-07-02 18:22 <nicoe> (he made a patch to use json-rpc)
2012-07-02 18:26 <bechamel`> __efx__: I think it is slow because proteus call the server for each iteration of the loop
2012-07-02 18:27 <__efx__> nicoe : is it faster with json-rpc
2012-07-02 18:27 <__efx__> I will try it when back home
2012-07-02 18:27 <__efx__> I can find the patch on pipy ?
2012-07-02 18:29 <nicoe> no the patch is on codereview : http://codereview.tryton.org/414002/
2012-07-02 18:29 <__efx__> thank you guys
2012-07-02 18:30 <bechamel`> __efx__: I think you will not get more than a 10% improvement
2012-07-02 18:30 <__efx__> really
2012-07-02 18:30 <__efx__> ok
2012-07-02 18:31 <__efx__> have to leave,
2012-07-02 18:31 <bechamel`> __efx__: if it is your main use case it's diffcult to have better perfs
2012-07-02 18:32 <bechamel`> __efx__: but proteus should be a better fit if you do not iterate on long lists
2012-07-02 18:32 <bechamel`> __efx__: a bit like a real user would do with the gtk client
2012-07-02 19:15 <rhubner> hi nicoe
2012-07-02 19:23 <nicoe> rhubner: hello
2012-07-02 19:26 <rhubner> nicoe: to make something functional in tryton client I was thinking of adding the widget the way I did in prototype... After I leave most unusual and beautiful
2012-07-02 19:26 <rhubner> nicoe: what do you think?
2012-07-02 19:28 <nicoe> That's a good start indeed
2012-07-02 19:29 <rhubner> nicoe: Mas eu precisava saber onde adicionar o widget e como chamá-lo.
2012-07-02 19:29 <rhubner> nicoe: ow sorry
2012-07-02 19:30 <rhubner> nicoe: I need to know where I call this widget
2012-07-02 19:32 <rhubner> tryton/gui/window/view_form/view/form_gtk
2012-07-02 19:33 <rhubner> nicoe: I was thinking of putting this directory
2012-07-02 19:33 <rhubner> nicoe: would it be correct?
2012-07-02 19:34 <nicoe> I think the container is defined in tryton/gui/window/view_form/view/form.py
2012-07-02 19:37 <rhubner> nicoe: is better developed in another file and call this file in form.py?
2012-07-02 19:38 <nicoe> I think indeed that you should develop it in another file
2012-07-02 19:39 <nicoe> But you will need also to be plugged in with the screen in order to be able to reload the form with the correct context
2012-07-02 19:42 <rhubner> nicoe: Therein lies the problem! I do not know how to connect this widget with modelview.py. How this should be done? Do I need to do anything else in other files?
2012-07-02 19:43 <nicoe> rhubner: of course
2012-07-02 19:44 <nicoe> You need to add the widget to the form view. And bind the callback called when you're moving the cursor to a reload of the current form with the datetime information taken from the widget
2012-07-02 19:46 <nicoe> rhubner: the screen object tryton/gui/window/view_form/screen/screen.py is probably the place where the reload should happend
2012-07-02 19:52 <rhubner> nicoe: Sorry to say, but I'm not understand anything of what I do. I'm lost in all these files...
2012-07-02 19:56 <rhubner> nicoe: I understood correctly how to make the widget but I do not know how/where must be happen this calls and callbacks in these files.
2012-07-02 19:56 <rhubner> :(
2012-07-02 20:01 <rhubner> nicoe: a very simple example (like hello world) would help me reproduce the widget I am developing. Is it possible you show something like this?
2012-07-02 20:02 <rhubner> nicoe: inadvertently abuse your patience...
2012-07-02 20:02 <nicoe> I'll try to make something tonight
2012-07-02 20:02 <nicoe> rhubner: I'll keep you posted
2012-07-02 20:05 <rhubner> nicoe: Ok.. thank you! I'll be connected if you have any news! I will improve the widget meanwhile..
2012-07-02 20:06 <nicoe> rhubner: OK. Did you understand what we meant by "zooming" in the time
2012-07-02 20:08 <rhubner> nicoe: i think so... There can be many changes at different times right?
2012-07-02 20:09 <nicoe> rhubner: yes
2012-07-02 20:10 <nicoe> rhubner: And I guess there will be a lot of changes in a short amount of time then a long period without changes
2012-07-02 20:10 <nicoe> rhubner: and then again a lot of small changes in a short amount of time
2012-07-02 20:10 <rhubner> nicoe: zoom would help focus on different sets of modifications far. I just do not know if I keep trying to change only in pygtk or longer would be better to add something in javascript.
2012-07-02 20:11 <nicoe> don't try to include javascript
2012-07-02 20:11 <nicoe> I think you should have a way to display this information
2012-07-02 20:11 <rhubner> nicoe: only pygtk now?
2012-07-02 20:12 <nicoe> Maybe a canvas above the timeline widget with histogram displaying number of changes per month/week
2012-07-02 20:12 <nicoe> rhubner: yes pygtk and a canvas library
2012-07-02 20:12 <nicoe> goocanvas would be a sensible choice since smoldersan (our other GSOC student) is also using it
2012-07-02 20:13 <nicoe> get in touch with him
2012-07-02 20:13 <rhubner> nicoe: good! I think it's best to learn, because I do not like web languages ​​like javascript
2012-07-02 20:15 <rhubner> nicoe: humm.. I'll take a look at goocanvas so... thanks
2012-07-02 20:17 <rhubner> nicoe: what time is it there? (I dont know what timezone you are)
2012-07-02 20:20 <nicoe> UTC+2 it's 20:19
2012-07-02 20:21 <rhubner> nicoe: here it's 15:20 (UTC - 3)
2012-07-02 20:31 <__efx__> bechamel: using jsonrpc instead of xmlrpc I have a decrease of around 60% in the duration with the simple script I made
2012-07-02 20:33 <udono> nicoe: rhubner: I tried out the timeline prototype review two weeks ago and I like it!
2012-07-02 20:39 <udono> nicoe: rhubner: Having a design question: Will the widget be shown per default on every view which model has history activated? (I don't know if the client already knows about _history property of a model...) or will it be controlled explicit like the other widgets in a view?
2012-07-02 20:40 <nicoe> I should be displayed automatically for every model I think
2012-07-02 20:40 <nicoe> Do you have another idea ?
2012-07-02 20:40 <udono> nicoe: No, I thing so, too.
2012-07-02 20:43 <udono> nicoe: I collected some ideas about the zoom, but really hard to explain gui objects in text metaphors maybe I try to draw some pictures...
2012-07-02 20:45 <nicoe> udono: ok good
2012-07-02 20:47 <lukio> hello, i have a problem to set a default field One2Many using a Wizard. my pastebin is at http://pastebin.com/MrbCYj9b
2012-07-02 20:50 <lukio> i want to set up a one2many field before the view appears
2012-07-02 20:54 <lukio> any idea?
2012-07-02 20:54 <lukio> thanks!
2012-07-02 21:46 <__efx__> In proteus, is there a way to close the connection after having call config.set_trytond or config.set_xmlprc ?
2012-07-02 22:02 <__efx__> from ipython if I use a %reset to reset all the variables I still can connect to my trytond server through proteus with no need to call config.set_... that s really strange
2012-07-02 22:02 <__efx__> no ?
2012-07-02 22:38 <bechamel`> __efx__: I think you can disconnect with the logout method on user
2012-07-02 22:42 <__efx__> bechamel: when do you say the logout method on user you mean on res.user model ?
2012-07-02 22:44 <bechamel`> __efx__: yes
2012-07-02 22:45 <__efx__> the User from User = Model.get('res.user') has only a login method
2012-07-02 22:46 <__efx__> either an instance of User, like that user = User()
2012-07-02 22:47 <bechamel`> __efx__: sorry, auth is made by the xmlrpclib, so disconnect should also be done through it
2012-07-02 22:48 <bechamel`> __efx__: and it looks like xmlrpc is stateless
2012-07-02 22:48 <bechamel`> __efx__: so it create a connection for each call
2012-07-02 22:48 <bechamel`> __efx__: this also explain why your loop on currencies is so slow :)
2012-07-02 22:51 <bechamel`> __efx__: if you really want to disconnect you may try config._config.current = None
2012-07-02 22:52 <__efx__> bechamel : do you mean config._CONFIG.current = None ?
2012-07-02 22:54 <bechamel`> __efx__: yes, it seems better :)
2012-07-02 22:54 <__efx__> bechamel: but in that case I can not do config.set_trytond... neither config.set_jsonrpc I have an AttributeError exception
2012-07-02 22:55 <__efx__> Ok I just have to start a new local thread
2012-07-02 22:55 <__efx__> so it is :
2012-07-02 22:55 <__efx__> config._CONFIG = None
2012-07-02 22:55 <__efx__> config._CONFIG = threading.local()
2012-07-02 22:56 <__efx__> bechamel: thank you very much :)
2012-07-02 22:59 <bechamel`> __efx__: are you using multithreading code ?
2012-07-02 23:00 <bechamel`> *multithreaded
2012-07-02 23:01 <__efx__> bechamel: no I am using proteus with django and I wanted to save the thread (only one) in memcache so that the same is used at each page access
2012-07-02 23:01 <__efx__> bechamel: I don't know if I am clear..
2012-07-02 23:04 <bechamel`> __efx__: I don't understand what you put in memcache actually
2012-07-02 23:07 <__efx__> bechamel : actually I don't know what to cache that is my current problem
2012-07-02 23:07 <__efx__> bechamel: I thought to cach something like config._CONFIG but that does not work
2012-07-02 23:09 <bechamel`> __efx__: as xmlrpc is stateless, you cannot cache a lot of stuff
2012-07-02 23:09 <bechamel`> __efx__: user name and password :)
2012-07-02 23:11 <__efx__> and could I cache something if I use config.set_trytond?
2012-07-02 23:11 <__efx__> bechamel: instead of xmlrpc ?
2012-07-02 23:11 <bechamel`> __efx__: so I update what I said earlier (if I undestand correctly how xmlrpc work): with jsonrpc you may hope to divide by two the time to loop on currencies :)
2012-07-02 23:12 <__efx__> bechamel: yes actually that's the result I obtained approximately twice faster
2012-07-02 23:12 <bechamel`> __efx__: what about caching the data themself ?
2012-07-02 23:13 <bechamel`> *themselves
2012-07-02 23:19 <__efx__> bechamel: your are completely right I even don't know why I was thinking of caching the thread instead of caching the data directly
2012-07-02 23:19 <__efx__> bechamel: again thank yo
2012-07-02 23:19 <bechamel`> __efx__: I know a webshop made with tryton that cache all the products and hit directly tryton only to place orders. It's really quick
2012-07-02 23:20 <nicoe> rhubner: ping
2012-07-02 23:21 <rhubner> nicoe: hi
2012-07-02 23:21 <__efx__> bechamel: okay I will use that strategy then !
2012-07-02 23:21 <bechamel`> __efx__: when everything is in cache tryton is webscale :)
2012-07-02 23:22 <nicoe> rhubner: I have a small patch that might help you a bit
2012-07-02 23:22 <rhubner> nicoe: great!
2012-07-02 23:23 <nicoe> rhubner: http://paste.debian.net/177466/
2012-07-02 23:24 <nicoe> It's quite simple: it adds a button under the form and makes the screen available to it
2012-07-02 23:25 <nicoe> rhubner: on this patch you have to build your timeline stuff and display it only when necessary
2012-07-02 23:25 <nicoe> rhubner: I hope it will help you
2012-07-02 23:25 <rhubner> nicoe: ok... only modifies this file or have others?
2012-07-02 23:25 <nicoe> rhubner: I don't understand
2012-07-02 23:26 <rhubner> nicoe: this patch you showed me only makes changes to the file form.py or other too?
2012-07-02 23:29 <nicoe> rhubner: it also adds a time_widget.py file
2012-07-02 23:30 <nicoe> rhubner: if you apply it on trunk afterwards you can do an "hg st" to see which files has been modified
2012-07-02 23:32 <rhubner> nicoe: ok, thanks for help! I still go out and start working on it tonight!
2012-07-02 23:32 <rhubner> nicoe: thank you .. see you tomorrow!
2012-07-02 23:47 <nicoe> rhubner: I'll go to bed now ;) see you tomorrow.

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