*** reinhard has joined #gnuenterprise *** kilo has joined #gnuenterprise good morning all good morning hi *** johannesV has joined #gnuenterprise good morning *** btami has joined #gnuenterprise good morning *** yure has joined #gnuenterprise *** bigbrother has joined #gnuenterprise *** bigbrother` has joined #gnuenterprise *** sacha has joined #gnuenterprise *** johannesV has quit IRC *** johannesV has joined #gnuenterprise *** btami has quit IRC *** yure has quit IRC *** jamest has joined #gnuenterprise reinhard: did you happen to look at the sample gsd files I put into gnue-samples? no, but I think johannesV did let me look quickly i'm curious to know if something like this could be expanded and all samples the applications setup to use this structure along with unit tests in gnue-contrib/objectWrapper/tests/objects I setup classes that wrapper those tables and setup unit tests that use the know info loaded into the tables to verify my code i could see the same done in all gnue-apps you mean write unit tests that use this thest data? we already did that in appserver, actually gnue-appserver/tests/data.py i thought the appserver test structure was just country address stuff? I'm seeing starship personnel :) that's the address :) where is the defintions for that stuff? address is including name, birthday etc gnue-appserver/samples/sample.gsd i swore that was just data eh yes it is you mean the schema? yes it's sample.gcd i'd like to have a master schema testkit like we talked about in gnue-samples that all apps/samples/tests can use if you're ok with that FWIW, it would be no biggie (IMHO) to move our test data to a different schema and I agree that we should use a common testkit the test schema i started with is a simplified version of stuff running here it's invoices in the sample but orders here AFAICT, the sample is ok it has a 1:N invoice - invoiceItem relationship but we still need to define appserver's schema using a gcd (as this populates the class repository) we should just take care that it contains all possible field types i'm still missing some types in that sample like booleans date, time, datetime, boolean, test, number with and without fractions so we'd want to add some fields one thing in that sample that was a gotcha for objectWrapper if you look at objectWrapper/tests/objects/invoiceAddress.py also, johannesV has introduced a fishhook for testing purposes in that Join defined in there you'll see a prePost should I? where the address has commit prior to the invoiceObject that was an odd case I wanted in the schema what's a fishhook? a table referencing itself like item -> replacement item that's a good one too or employee -> his boss *** derek has quit IRC address -> invoice address also if you could spare a minute to look at objectWrapper/tests/objects/invoice.py down at the bottom I have a section called Accessors yes, I see it where it maps class fields to converters so that setDecimal converts FIxedPoint, strings, floats, ints to Decimal and setDatetime does something similar i find myself doing that all the time but I didn't know if it'd be of use in common at all in my case those lines at the bottom take care of all conversions for me in my code and I no longer worry about what the db provides something else not shown in invoice.py is a coalesce() function which works exactly like postgresql's coalesce so instead of doing if foo is None: bar = {} else: bar = foo i just do bar = coalexce(foo, {}) or coalesce(x,y,z) again, i'm using this a lot it's a minor thing but handy * jamest is trying to figure out if any of this would be of use to others and if so where I'd put them in common which reminds me FWIW, appserver does this setDecimal etc stuff internally. not sure how it would be used in common outside the object wrapper bar = coalexce (foo, {}) seems to be the same as bar = foo or {} I don't understand what coalesce (x, y, z) would do hmmmmm picks the first non null value ah bar = x or y or z :) *** kilo has left #gnuenterprise lol i hadn't thought about just using or readgsd.py made me think of my coalesce as it does the if foo is not None stuff sometimes the if foo is not None is better readable/understandable sometimes I think foo = a or b is enough reinhard, watch out ! if foo is 0 doing something like bar = foo or {} ... would set bar to {} instead of 0 that's the same issue as the x and x or y trick to mimic the C ?: operator so if one has to check the Null-state of a value doing a "poor man's ternary operation" is not the same oh, a postgresql 8.1 gotcha postgresql 8.1 no longer created oids by default on tables johannesV: yes, right but we expect them unless we specifically specify the PK fields to use but if we specify the PK fields then our datasources always add that field value in as NULL which can blow up the insert as insert into invoice (invoice_no) values (Null) will ignore the fields default setting and issue an error you can see the issue if you run the objectWrapper unit tests after uncommenting out the post after "TODO: The old " in the joins.py file hmmm..... you can force postgresql 8.1 to create the oid field if you create the table with "WITH OIDS" option Base/RecordSet.py line 197 # 3. Set the primary key fields to dirty, so they will be included in the # insert statement in any case. why did I do this? I think it was related to the appserver backend i can't think of a reason forms or any of my apps would require it but I think the main issue is our dependence on OIDs in pgsql i'm no where near up to speed on gnue-common but at one time we had the oid field hardcoded in as the pk and it didn't try to figure out the pk, you could only override the oids are good and necessary they are discouraged in postgresql 8.1 without oid, you can't use db triggers to generate a primary key well, 8.0 discouraged? but 8.1 flipped them off by default yes so if you have a table where the pk is assigned from a serial no new table created in 8.1 will have them unless you specifically tell it to create them how would you find out which serial you got on an insert? i'm pretty sure there's a function to retrieve that value i honestly don't know, i'm just bringing to light a nasty that bit me when I moved to 8.1 recently my _primaryKeys="" hack in objectWrapper got me around it in most cases (sqlite3 for instance, provides this number via cursor object: cursor.lastrowid) but not in cases where i have the serial populated by a default nextval('seq') as then the insert of the NULL by common blows it up hmmmm s/hmmmmm// *** jcater_ is now known as jcater so now that I shared the 8.1 love how should I proceed on the gnue-samples? do I move the gcd and gsd sample files into appserver then make the schema's sorta match? well, make them match acutally I'd say just go on with the 2 tier sample and we will port it to appserver if that is ok for you sure, but I'm ok with working with the appserver defs too if you guys can put up with lots of questoins what is the appserver test schema? its a schema used for testing testing is what you do with code before you give it to users i'm sure that's what threw you jcater: currently we use a simple address management with 2 tables, but we will change to what jamest is now building in gnue-samples jamest: what is your schema? it's a simple invoice atm with items and address tracking okay *** chillywilly has joined #gnuenterprise if you have something better I'm open to change i just needed something more than my test_detail and test_master tables at work not necessarily and wanted it for gnue I'd just like to use something common for some of my stuff too i think we're talking about revamping all the various samples in gnue as so many are broken and make a single, consistant sample system yeah nothing complex that's what I started in gnue-samples reinhard: do you agree with that? *** sacha has quit IRC jcater: we'll end up with two sets of schema (two-tier and appserver) I had someone create an employee/project assignment/timeclock schema inhouse for sample stuff too but I'd like to be using one consistent w/gnuew gnue where the appserver one has gcd's to create it, and gsd to populate it well, i think we could probably put that in gnue-sample as well if everyone is ok with it as I see this populating the 'gnue' database with a very simple but sorta complete system I wasn't pushing for mine, btw in any way i'm looking for samples :) as I want I've done is dumb down the ones from work we have 300 employees with full addresses s/want/what as no way to I care to have a demo which consists of the horror which is the simplified sales tax plan here in the US those are demo employees? yeah i think it'd be nice to have those samples, especially due to the size of the dataset reinhard: would that be OK to add to samples? * jcater would rather see one sample set though... I'm cool with invoices I was just trying to stay in the loop so I can use them too :) I agree that we should have *one* sample set and even more, I think it should not be too complex and I am not sure if we really need 300 records in our sample database as 300 is too little anyway to do performance tests fwiw, this sample set was mainly used for reporting tests which explains the size but I agree and OTOH it's too much as that you could easily predict what should come out of a specific operation so what would be a good size as in the case of invoices i think 1 is a tad small :) in the appserver sample I think we had 5 records I think something between 5 and 10 might be enough but I won't hold you back :-) 5 to 10 seems fine to me as I'd like to have a few to throw different combos at stuff my invoice compiler unit tests here run thru all the invoices created for the month well, imho, we need a schema that has a few core tables that might be 5-10, but has some sort of detail tables that can be larger as 5-10 is a great sample test size for stuff like appserver, forms, etc and it hasn't been uncommon that the 304th invoice blows up due to some minor thing but not for reporting or other aggregate-type things which for invoicing, could be some sort of "transaction history" table if nothing else jcater: can you convert your sample stuff to gsd then, or give to me and I will good idea with transaction history reinhard: do you see what I'm getting at? would also fit the reporting area yes sure imho, the perfect schema is one that allows you to access either a small or a large data set depending on your needs agree i need less users and more time *** klasstek has joined #gnuenterprise *** derek has joined #gnuenterprise *** johannesV_ has joined #gnuenterprise *** johannesV has quit IRC jamest, i've just commited a new version of postgres' Behavior.py now you should be able to do something like: gnue-schema -c newone -d -u dbadmin -p --owner=gnue --ownerpassword= gnue.gsd cool, thanks that should connect to the server using dbadmin/, add (if necessary) a user "gnue/" and finally creates the db as given in "newone" connection successive connections to that db might follow as user gnue/ of course bbl so if we're moving to just the invoicing sample what do we do with all the samples in, say gnue-forms, that access the db pitch them? finally yes I'd guess > 50 % of them are broken anyway ok we've got stuff all over the place and I can (hopefully) put a little time each day into cleanup should we keep any samples in the individual tool dirs? like helloworld for forms or move all of it to samples say a appserver, two-tier, and unbound dir.....maybe I wouldn't mind ditching helloworld.gfd (but I also wouldn't mind keeping it) but where to put? i can see advantage in having all the gnue-samples in that it'd be simple to compare the 2tier to the appserver samples since they are going to do the same thing and I'd imagine in some cases the forms will match I don't really care much about the helloworld.gfd you can put it 2-tier if you want I will easily port it to appserver ;-) i mean in general though where will all samples go? I think we might still keep a per-tool samples directory thinking about it, there are some things in appserver/samples that we might well keep besides the big general sample no way to port them over, or just basic functionality samples? i could see common having lots of non db samples things that we do not *want* in gnue-samples like special broken testcases to test exceptions or benchmarks ok *** johannesV_ has quit IRC *** johannesV has joined #gnuenterprise *** krizz has joined #gnuenterprise btw, i saw the new forms splash this weekend who made that? it was me :) do you like it ? *** reinhard has left #gnuenterprise it's better than the old one by far :) thanks ... :) *** reinhard has joined #gnuenterprise i had some spare time left and, well, i needed to do some creative work ... http://www.rahoi.com/2006/03/may-i-take-your-order.php *lol* :) *** johannesV has quit IRC *** krizz has quit IRC *** kilo has joined #gnuenterprise *** reinhard has quit IRC *** jamest has left #gnuenterprise *** sjc has joined #gnuenterprise *** klasstek has quit IRC *** kilo has quit IRC *** jcater has quit IRC *** jcater has joined #gnuenterprise jcater: you there? depends on who's asking derek there is the ruby meeting starting in 10 minutes ;) im still at work chances of me making 1 hour away in 10 minutes when i have 30 minutes of work or more left is slim to none :( *** jcater has quit IRC *** SachaS is now known as SachaAway *** derek has quit IRC *** jcater has joined #gnuenterprise *** sjc has quit IRC *** derek has joined #gnuenterprise