*** ayers has joined #gnuenterprise *** reinhard has joined #gnuenterprise good morning reinhard: good morning! :-) I've got my application partially running. But I have a few questions/issues. shoot :) OK.. first off... I have a "Customer" I have a "Mailing" that refers to a "Customer" In the layout file of the customer I have a search position for tha customers 'code'. When I edit a mailing I therefor have a lookup for customer code to assign the customer... everthing is fine. ok But now I have a mailingentry (mailing to mailing entry is a to many relationship) The Mailing also has a 'code' but I also want to add the customer 'code' as search field for the mailing entry. I can add the "customer" field, but that lookup will show me the internal gnue_id. (i.e. I can add the 'customer' search field to the 'mailing' layout.) So I suppose I need to actually add a 'customercode' field to the mailing that gets syncronized with the 'customer' attribute. mailingentry : mailing is 1:n ? no mailingentry : mailing = n:1 ? the later, yes and mailing : customer = n:1, too? ACK ok, I see I think I'd have to take a closer look at this I can send you the code... if you like? I think that would help thank thanks sure it's on its way... I'll see if I can setup a svn repository for it... the active folders are ./etc ./classes ./layouts ./processes the ./barcode is an unrelated tool... ./form just conains experiments and ./schema was an attempt to load data into the tables defined by classes (but haven't got it to work yet) oka y will look at it later Thanks! *** johannesV has joined #gnuenterprise *** btami has joined #gnuenterprise *** snigelgr has quit IRC *** johannesV_ has joined #gnuenterprise *** johannesV has quit IRC how can one traverse realtionships (i.e. attributes referencing other classes) in OnChange code? I'm trying something like:   if propertyName == 'ADM_customer':  self.customercode = newValue.code  ]]>  where I thought newValue would contain the object... but it seems to be a unicode string. I think you might need something like mycustomer = find('ADM_customer', conditions={'gnue_id': newValue})[0] to find the object or rather mycustomer = session.get('ADM_customer', newValue) This may do the trick... but now I've got an acception because the code is trying to modify read-only attribute. I thought read-only would only apply to the UI and not to code... Let my try to change that for now... let me add that I consider it very unlikely that you really end up needing a redundant customer id in that class OK... :-) but of course a learning effect is there when trying how it *would* be done if you needed it :) Well I will need it later anyway for presetting values. But actually I'd like them to be preset immdieatly (as in form like triggers) rather than on commit. But I suppose I would need a read form (as opposed to a .gld) to do that. you mean preset for new records? you would do that in OnInit Well preset depending on assigned values ie: Customers define prefered character sets. so when I create a new mailing and I assign the customer the character set of the mailing should be set to the same value as the customer. s/customer./customer's./ During OnInit the customer hasn't been set naturally so I can't determine the character set for the mail at that time. To work around that, I could create three attributes: 1st: a calculated attribute from the customer's character set 2nd: a real property for the mailing's characterset which will remain empty by default 3rd: a calculated attribute that will either take the mailing characterset if set or the customers version. hmm well I guess I could drop the first attribute. yes that would be something like Character set: (o) Customer standard (ISO-8859-1) ( ) individual: _____________________ it's a matter of taste whether that is better than just having a charset and having it change automatically with every change of the customer field you can do both I can't seem to get the read-only attribute out of the repository... I guess I'll need to recreate it. should I be able to load data with gsscvs and a .gsd file into a repository created by *gcd class files? sure there is a list of countries in the samples IIRC seem I need to set gnue_id the examples with the country doesn't use classes.. it uses schema and tables. so I wasn't sure that would work is there a way to dump the current data into a data file? It also uses a schema with a primarykey definition.. can that also be done with classes? * ayers tries Unbekannter Tag It also seems that gsscvs cannot find the correct table for the class either. I've tried both tablename="Classname" and tablename="Module_Classname" both raise exception that they cannot find the table. my command line looks like: sudo gsscvs --connection=appserver --mode data schema/data.gsd And I get: ERROR:exception.system.exceptions.KeyError:Unhandled exception KeyError: ... File "/usr/local/src/svn/gnue/gnue/.svndevelbase/gnue/common/datasources/readgsd.py", line 408, in __import_data raise InvalidFieldsError, (item.tablename, n, KeyError: u'ADM_Characterset' ayers: you must import the data into the backend connection directly to the database not into the appserver connection OK. so that would be [gnue] in my case I believe... sudo gsscvs --connection=gnue --mode data schema/data.gsd yes same error... though... (although I wouldn't run that as root...) -rwx-----x 1 root staff 221 27. Apr 12:49 /usr/local/src/svn/gnue/gnue/gnue-common/scripts/gsscvs the setup-svn.py script setup the all the scripts to only be read a execuaable by root. that is strange Well I /think/ it was the setup-svn.py script... probably a matter of the umask setting I surely didn't check it out as root. I'll simply do a: sudo chmod g+rx /usr/local/src/svn/gnue/gnue/gnue-*/scripts/g*cvs for now hmmm I think you should check the fieldname it also has to be ADM_something in your gsd file Ah, thanks, we are getting further... Yes!!! actually the exception should be "no field name foo in table bar" but there seems to be a bug in the exception handling code :( which raises another exception and makes the original exception invisibe invisible ahh OK. should I open some kind of bug report for this? (once my app is done I can look whether I can help with a fix) our bug tracker is down :( gnue.org and gnuetnerprise.org have moved a few weeks ago and not everything is up again :( ACK... I think I fixed it * ayers updates It seems you left some debug code ;-) ERROR:exception.application.gnue.common.datasources.readgsd.InvalidFieldsError:Unhandled exception InvalidFieldsError: InvalidFieldsError: Table 'ADM_RegistrationType' has no field 'code, description' works as expected! Thanks! yep, removed the debug code again the navigator resizing is hiding my fields.. Let me comment out the description in the process definition. It seems properties defined the gcd class files but ommitted in the gld layout files are appendend in the generated form. is there a way to hide these properties in the generated form? hmmmm I am not sure in any case, you could put them on a different tab so they don't clutter up the main form you can define tabs int a gld file? yes Cool I though block could only be defined in forms *thought *blocks page=... * ayers tries Loading GNUe language definitions ERROR:exception.application.gnue.common.definitions.GParser.MarkupError:Unhandled exception MarkupError: XML markup error in '[unknown]' at line 29: Error processing tag [I do not know what a tag does] oh sorry in the gld yeap Great! Cool! *** Morphous has joined #gnuenterprise The ordering ofthe pages is always alpahabetical? *** Morphous_ has quit IRC I think it is, yes *** jamest has joined #gnuenterprise *** btami has quit IRC bbl *** ayers has left #gnuenterprise *** ayers has joined #gnuenterprise *** jcater has joined #gnuenterprise *** Morphous_ has joined #gnuenterprise *** Morphous has quit IRC ayers: ok, looked at your sample I think the best way is to have a hand crafted form instead of the generated one here for now actually it would make sense to have the read only fields being really read only fields in the generated form instead of entries with style="label" so you can also search for them but I think we will do that with next appserver release series so appserver 0.5.x remains compatible with form 0.5.x (IIRC read-only fields did not work too nicely in gnue-forms 0.5.x) you can save the generated form to a file using "gfcvs appserver://appserver/form/ADM_mailingEntrySessionShort?debug-file=foo.gfd" so you have a starting point *** jamest_ has joined #gnuenterprise *** jamest has quit IRC *** jamest_ is now known as jamest back *** jamest has quit IRC reinhard: Thanks! I'll try that! *** jamest has joined #gnuenterprise *** jamest has quit IRC *** jamest has joined #gnuenterprise *** derek has joined #gnuenterprise *** sjc has joined #gnuenterprise *** Morphous has joined #gnuenterprise *** Morphous_ has quit IRC int the PRE_FOCUSOUT field trigger, self seems to be the field. do we have access to the current object? *** johannesV_ has quit IRC Acually I currently do not need access to the object. I've looked at the invoces.gfd examples So I'm trying to have a POST-CHANGE trigger that sets values in other fields but it seems like it's currently not trigger (in my setup) ah wait... *** jamest_ has joined #gnuenterprise *** jamest has quit IRC *** jamest_ has quit IRC *** jamest has joined #gnuenterprise off for today *** reinhard has quit IRC *** jamest has quit IRC *** ayers has left #gnuenterprise *** jamest has joined #gnuenterprise *** jamest has quit IRC *** sjc has quit IRC *** jcater has quit IRC *** bigbrother has joined #gnuenterprise *** jcater has joined #gnuenterprise *** derek has quit IRC *** jcater has quit IRC