*** derek has joined #gnuenterprise *** aries_mindworks has joined #gnuenterprise hi *** bigbrother_ has quit IRC *** bigbrother has joined #gnuenterprise *** johannesV has joined #gnuenterprise good morning doh... i think that is my signal that it's past my bedtime :) :) :) hi all hi aries_mindworks now the curses driver seems to me working, but if when I tried in gnue-invoice to make a new invoice, it said: hm, curses does not support images :) maybe we should think about ascii-arts .... ok, It won't show me the image, but it would nice if I can enter data *lol* johannesV: :) so, does the form stop there or what happens ? it should strip the unsupported features johannesV: It brings me back to tha "main" page johannesV: where I can see the grid, I cannot enter new invoice hm, i don't know gnue-invoice very well so maybe kilo could give some help there ... *** reinhard has joined #gnuenterprise hi all reinhard: hi *** johannesV_ has joined #gnuenterprise *** johannesV has quit IRC *** btami has joined #gnuenterprise *** yure has joined #gnuenterprise I've try to implement a calculated property it should select the last value of a previous records given value eg. customer's balance (number(5)) where -50$ on the last time. I'd like to get this value. how can I do this? I don't understand you mean previous as in "first record, next record..." or previous as in yesterday? the previous record of that customer a customer has more than one record? like this: select balance from customer where customer.id=500 sorry I still don't understand is there more than one class involved? and how are they related? *** kilo has joined #gnuenterprise *** erkkie has joined #gnuenterprise reinhard: there's a property reinhard: I've sent you a mail haven't got any mail from you reinhard: I've sent it to reinhard@gnue.org 2006-02-01 11:53:54 1F4FcU-000HjY-1n == reinhard@gnue.org R=dnslookup T=remote_smtp defer (-44): SMTP error from remote mail server after RCPT TO:: host mail.gnuenterprise.org [70.158.36.94]: 450 : Recipient address rejected: Greylisted for 300 seconds (see http://isg.ee.ethz.ch/tools/postgrey/help/gnue.org.html) erm aries_mindworks: please avoid writing email addresses in this channel this channel is logged on a web page indexed with google please try reinhard (dot) mueller (at) bytewise.at off to lunch reinhard: ok, sorry erh just got your mail :) will look at it after lunch reinhard: thanks *** kilo has left #gnuenterprise ok trying to understand shouldpay is what the customer should pay for *this* order, right? and balance is what the customer should pay for *all* of his orders? including this one? yes you're right so you would do something like orders = session.find ('orders', conditions = {'netezo': self.netezo}, propertylist = ['shouldpay']) for o in orders: sum += o.shouldpay return sum and of course you would initialize sum to 0 before the "for" line reinhard: thanks, i'll try it reinhard: I was thinking about doing a in-stock counter for items in a way similar to that.. I would have to count all shipping orders & all sales orders & the sum would be the current "in-stock" counter.. but I worried how would this scale with large amounts of orders erkkie: I can predict that quite well it would scale *horribly* as it would result in a SQL query for each time you access the in-stock counter reinhard: yeah, I figured that:) I would rather have on-validate and on-delete triggers that update a stored field yeah, that was the way I did the stuff eventually and a method to recalculate in case it gets out of sync ever but that has concurrency problems, but fortunately, my stuff is single user.. and yes, I figured, that I'd need to to consistency checks every now and then but I haven't implemented the checks yet was thinking about implementing a custom transaction queue of some sort, but haven't had the time to get around figuring the exact order of the validation triggers wasn't sure if it would be easily done with .gcd files only calculated field *might* be worth discussing for stuff like "reserved stock" (like in accepted but not yet fulfilled orders) *** btami has quit IRC concurrency problems should actually be solved by the database all OnValidate and OnDelete triggers run within the same atomic transaction that also stores the actual change I read the postgresql locking docs, somehow I got the picture that in some cases consistency isn't guaranteed, unless there's a locking statement in the sql query... I haven't checked the queries that appserver produces, so I could be just trolling here:p reinhard: I just looked at the sql queries that appserver makes.. it set the transaction isolation level to serializable.. I don't fully understand the different isolation levels yet, but I trust that takes sure of the concurrency stuff erkkie: honestly I wouldn't *bet* on it but at some point appserver will support active locking reinhard: yeah, you must be sick of repeating that to me:) *** yure_ has joined #gnuenterprise *** aries_mindworks has quit IRC *** jamest has joined #gnuenterprise *** jcater has joined #gnuenterprise *** btami has joined #gnuenterprise *** sacha__ has quit IRC *** sacha__ has joined #gnuenterprise *** sacha__ has quit IRC *** btami has quit IRC hmmm i thought that datasources would cast data to match the DB field so that a boolean field in the table would be a boolean data type no never did and in fact I think introspection is not reliable enough to do *that* ok for example, some backends simply have not boolean but use a int wait, we did that in the display handlers in forms didn't we right *** derek has quit IRC *** klasstek has joined #gnuenterprise reinhard: you here? yes whoops. still here? in and out same here ok i was hoping you could give some feedback on that object wrapper right now in python i can do class Order(ObjectWrapper): """ Contains basic information about a single pickticket """ _tableName = 'orders' _properties = (Field('order_id', typecheck=int), Field('created'), Join('payments', className=OrderPayment, masterLink='order_id', detailLink='order_id'), ) or things like Join('actualItems', className=OrderItem, masterLink ='order_id', detailLink='order_id', extraConditions = { 'item_type' : 'EQUIV', } ) which sets up objects with the attributes 'order_id', 'created', and a list named actualItems Fields can also map from table field name to different instance name and you can specify an optional typecheck=float,Decimal,int, basestring, etc,etc which can then test fields that you setup getters and setters on so a complete object mapping would read something like class Master(ObjectWrapper): """ Contains basic information about a single pickticket """ _tableName = 'test_master_table' _properties = ( Field('master_id', typecheck=int), Field('decimal_field', typecheck=float), Field('txt_field', typecheck=basestring), Field('bool_field'), # , typecheck=bool), Join('details', className=Detail, masterLink='master_id', detailLink='detail_id'), ) then you can access it like order = Master() order.load(master_id = 1) assert order.txt_field == 'Master 1', \ 'Object did not load properly' assert order.bool_field == True, \ 'Object did not load properly' assert len(order.details) == 5, \ 'Object items did not load properly' so that's the basic functionality with load, multiload, and post methods I know yesterday we talked about adding limits on the fields pulled in a load and I'm curious if this is still close to appserver's object setup yes it is except that in appserver you can't predefine a list property FWIW, I don't want to explicitly pour salt into anybody's wounds here, but I just tried a 12 year old trousers for carneval and it still fits ;-) lol reinhard: do you have any suggestions on making this more appserverish? also if I add a limitFields option to both loads and joins so object.load(master_id =1, limitFields=['instanceFieldName','instanceFieldName2',etc]) and the same list as part of a join Join('details', className=Detail,masterLink='master_id', detailLink='detail_id', limitFields=['instanceFieldName','instanceFieldName2',etc]) what issues do you recall that would have remained that prevented you from doing imbedded lists in appserver also, i'm thinking on a Join of having another arg type='single' or type='list' so that if single then the details attribute would be an instance instead of a list lunch, bbi1h jamest: issues were field selection and sorting the main issue with field selection is that you probably can't predefine it because in one case you need item numbers for order items, in other case you need price, in other case you need both bbl too *** johannesV__ has joined #gnuenterprise *** johannesV_ has quit IRC back reinhard: you wouldn't pass the fields in as part of the master object load? hmmm that could make sense actually that sounds like a really good idea load (....., childFields = {'details': ['a','b','c'}, 'partList' : ['z']} something like yes or even (more appserverish) propertylist = ['field1', 'field2', 'list.fielda', 'list.fieldb'] I seriously start to reconsider list properties i'd think ordering would work the same way well ordering could possibly be predefined for the list property where order could be either a GConditional tree, or a string i'm not following what you mean by predefined for the list property *** dimas_ has quit IRC jamest: there are things you define when you define the object and other things you only give when you use the object later, like as parameter in load() or such I understood that for example the link between the tables is "predefined" (means declared in the object definition) ok, but what if I have an order and I load the orders for a report where they list items in the order entered then I load the same order for a report but items are sorted by value Order 1 Pos 1 item $50 Pos 2 item $10 vs Order 1 Pos 2 item $10 Pos 1 item $50 i could see changing the sort order of detail lists as useful in cases like that as i have several web reports where the user can change the sort order of the results on the fly *** sjc has joined #gnuenterprise In that case you would do 2 separate datasources (maybe) you can always do a separate load() for the details as you need it those list properties are only a kind of shortcut for that load() per master record at least that is my understanding *** johannesV__ has quit IRC hmmm ok not saying that this is the right approach just it's the approach I had in mind when last thinking about it :) should I put this object wrapper into common somewhere i see it as a go between for me moving from relational stuff to something more appserverish i also see it as similar to sql objects but it's not appserver obviously :) * jamest is trying to figure out if he should just leave in his svn tree or if it has value outside this company hard for me to tell I won't use it, however I see it might be of use for others you could also consider parking it in gnue-contrib for now and when we see people adapting it then make it "official" good idea s/adapting/adopting/ where would be the best place to find appserver api usage i really want this thing to get me closer to porting to appserver but with appserver being an all or nothing option i can't begin to jump from my old relational way of doing things to appserver company wide but if I can make object wrapper API very, very close to appserver then (I hope) the jump would be much, much easier *** derek has joined #gnuenterprise jamest: the appserver devguide should help as to all or nothing you might be interested in the latest wishlist items in our tracker ;-) (I really see this as a problem, too) appserver devguide should be downloadable from our web page must run now cu *** reinhard has quit IRC *** kilo has joined #gnuenterprise *** jamest has left #gnuenterprise *** klasstek has quit IRC *** yure has quit IRC *** derek has quit IRC *** kilo has left #gnuenterprise *** jamest has joined #gnuenterprise *** erkkie has quit IRC *** sjc has quit IRC *** jcater has left #gnuenterprise *** jcater has joined #gnuenterprise *** jamest has quit IRC *** dimas has joined #gnuenterprise *** jcater has left #gnuenterprise