Anyone know how to put some images in ZClass? I have done things like putting ZClass with base class OFS:Image but with it I can only assing one Image do the object... I need to assign two or tree images do the object. Thanks... -- Diego Rodrigo Neufert Webmaster / Web Developer - Magic Web Design ----------------------------------------------------------- diego@magicwebdesign.com.br www.magicwebdesign.com.br Curitiba - PR - Brasil
Hello, I am building a small community site. I am building the login/signup system. I have a problem with the creation of new users on signup. I have a users zclass which is catalog aware. I used the job board tutorial to set it up (thanks! very useful documentation) When I a user signs up I search the catalog for their username, because I want to keep that unique. here is the code: Content-type: application/x-www-form-urlencoded <dtml-in Catalog> _root.feedback=sorry+name+taken <dtml-if sequence-end> </dtml-if sequence-end> <dtml-else> <dtml-var add_user_dtml> </dtml-in> This page is passed the variable "username". This works to catch existing usernames most of the time. However, in a few cases it will miss the fact that the name matches an existing name and go ahead to the <dtml-var add_user_dtml> page: <dtml-call "REQUEST.set('password', signuppassword)"> <dtml-call "REQUEST.set('username', username)"> <dtml-with "manage_addProduct['swatchuser']"> <dtml-call "swatchuser_add(_.None, _, NoRedir=1)"> </dtml-with> _root.feedback=success This code usually successfully adds a new user. However if the username is a duplicate (it shouldn't arrive at this page, but if it does) it will only successfully make a new zclass instance of the user if they are a single letter long!!!! Thus I get a user list that looks like this: max , yay , josh , mary , peter , john , ann , dog , cat , badger , fork , g , k , ww , u , u , u , u , u , b , u , erm , frog , erk , damn , erkf , this , bg , q , q , e , u , aname , j , j , j , j , j , j , j , j , j , j , amy , y , y , y So for single letter names the user signs up no matter whether someone else has that name or not. Which is not what I want. But the problem does not end their, else I would just not permit one letter name. For those who choose names of more than one letter, they may be told that they have successfulluy created a new user when they haven't. The times when this happens are usually if I haven't closed and opened the browser between sign-ups. However it happens seemingly randomly. I am calling all this code from a flash file in the same directory. I have the same thing working using zope and SQL no problem, but can't work it out with zcatalog. Unfortunately I need to! My first inuitions are that: 1: it has something to do with the pages being cached. 2: I am not updating the catalog properly, though I added the lines suggested in the job board tutorial to the add method of the zclass: <dtml-call reindex_object> Any hints will be appreciated... I think I may be reporting the same problem that is mentioned in: http://www.egroups.com/message/zope/44901 but I am not sure. thanks for your time josh on =========================== write: josh@futurefarmers.com read: www.futurefarmers.com read: www.crd.rca.ac.co.uk/~josh interrupt (i love it): (415) 552 2124 =============================
Diego Rodrigo Neufert wrote:
Anyone know how to put some images in ZClass? I have done things like putting ZClass with base class OFS:Image but with it I can only assing one Image do the object... I need to assign two or tree images do the object.
I've been thinking about something similar myself. I'd like to create a ZClass/ZPatterns version of the Photo and ZPhotoAlbum products (or at least a reasonable equivalent). Specifically, I'd like to incorporate the functionality that, upon instantiation of the object, creates the neccesary sized versions and stores them. I'd like to use ZPatterns to be able to switch the storage between the ZODB, the file-system, or BLOBs in an RDBMS without altering the rest of the application. Any progress that you make would be very helpful to me. Michael Bernstein.
On Sat, 9 Dec 2000, Diego Rodrigo Neufert wrote:
Anyone know how to put some images in ZClass? I have done things like putting ZClass with base class OFS:Image but with it I can only assing one Image do the object... I need to assign two or tree images do the object.
Try to subclass OFS:Folder. In that folder you can put as many images as you want. I have 1 ZClass deriving from both Folder and DTMLMethod and it works fine. (I had some trouble with setting view tabs properly, but finally I solved it.) ololo@zeus.polsl.gliwice.pl /--------------------------------------\ | `long long long' is too long for GCC | \--------------------------------------/
participants (4)
-
Aleksander Salwa -
Diego Rodrigo Neufert -
josh on -
Michael Bernstein