Re: [Zope-dev] zpatterns-0.4: defaults attributes, more...

2000-07-13 Thread Jephte CLAIN
"Phillip J. Eby" a écrit : > Try: > data=(self.which_one and [self.second_data] or [self.first_data])[0] wow. what a *clever* idea to use [] around self.???_data. I used to write: data=self.which_one and self.second_data or self.first_data but this failed because sometimes self.second_data is a

Re: [Zope-dev] zpatterns-0.4: defaults attributes, more...

2000-07-13 Thread Phillip J. Eby
At 07:11 PM 7/13/00 +0400, Ava wrote: > >first generic attribute provider: >fromexpr = '(self.id[0] and sql_get_first(key=id[0]) or [NOT_FOUND])[0]' >attrsexprs = ['first_data=RESULT.data'] > >second generic attribute provider: >fromexpr = 'self.id[1] and sql_get_first(key=id[1]) or [N

[Zope-dev] zpatterns-0.4: default attributes, more

2000-07-13 Thread Ava
hello, ignore my precedent post. too much caffeine, not enough sleep my problem is solved if I use the class_default_for_X trick... regards, [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev

[Zope-dev] zpatterns-0.4: defaults attributes, more...

2000-07-13 Thread Ava
hello, thanks to philipp for its explanation for 'class_default_for_X'. I'm not at the office now, and I can't do a reply on the message from the archives ;-) I have a rack that must retrieve informations from 2 sql tables. I set up 3 generic attribute providers: - one that get data from the fi

Re: [Zope-dev] zpatterns-0.4: creating an item in "virtual mode"

2000-07-05 Thread Phillip J. Eby
At 11:14 AM 7/5/00 +0400, Jephte CLAIN wrote: >Hello, > >I use virtual attribute access to provide access to my SQL database. >However, I want to use the Rack.newItem facility to create new records >in the database. >But it fails because in virtual mode, an item always exists. >This patch solves t

[Zope-dev] zpatterns-0.4: creating an item in "virtual mode"

2000-07-05 Thread Jephte CLAIN
Hello, I use virtual attribute access to provide access to my SQL database. However, I want to use the Rack.newItem facility to create new records in the database. But it fails because in virtual mode, an item always exists. This patch solves the problem, at least for me --- Rack.py.orig

Re: [Zope-dev] zpatterns-0.4 ?

2000-06-06 Thread Phillip J. Eby
At 08:21 PM 6/6/00 +0400, Jephte CLAIN wrote: >Hello, > >I have used ZPatterns-0.3.0 to complete a project that I shipped >yesterday. Congratulations, you're even braver than I am. ;) >Although I had to write a CatalogAwareRack/Specialist to allow me to >search for rackmountables, I can say th

[Zope-dev] zpatterns-0.4 ?

2000-06-06 Thread Jephte CLAIN
Hello, I have used ZPatterns-0.3.0 to complete a project that I shipped yesterday. Although I had to write a CatalogAwareRack/Specialist to allow me to search for rackmountables, I can say that ZPatterns has saved my life! I would like to thanks Philip for this great contribution. (too bad I no l