Re: Howto Image (picture) instance variable of the class
Esteban Maringolo <[email protected]> Thu, 3 Jun 2021 16:10:15 -0300
| Newsgroups | gmane.comp.lang.smalltalk.squeak.seaside |
|---|---|
| Message-ID | <CAJMgPC+EqQg6gu1wAEhj8snJZP29eDD+VSMaCLSaXDLGidGbCQ@mail.gmail.com> |
Having picture1, picture2, as separate instance variables is a too naive implementation and would hit limitations very easily. In the next simplest implementation of this I would recommend that the "Product" class has a "pictures" instance variable referencing an OrderedCollection, and each element of such collection is the path to the image file on disk. So when you upload the file from a form you save it to a certain location on disk and then update the product instance collection of pictures. Regards, Esteban A. Maringolo On Thu, Jun 3, 2021 at 3:52 PM Oswall Verny Arguedas C. <[email protected]> wrote: > > Greetings, > I have a query about saving instances of a class that are of type image (picture). > For example. I have a Product class. This class must have two photographs of that product. I have to save two instance variables of the Product class, picture1, picture2. > These images must be uploaded from the Product form and displayed after uploading. > In Seaside what would be the best procedure to do it. > I don't know if WAFileLibrary would be the best option. > Thanks in advance. > Oswall > _______________________________________________ > seaside mailing list > [email protected] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside _______________________________________________ seaside mailing list [email protected] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside