Re: [Zope] NEWBIE: assign next free ID automatically

2000-10-15 Thread Kapil Thangavelu

ola, 

the below will should work fine, although the _string.atoi is unesc
since you can just use 0, or 1 by itself inside "" and have it treated
as an int and its a bit inefficient to use objectValues over objectIds
(list of objects vs. list of strings) although it saves you from having
to do a dtml-let doc_id=sequence-item to evaluate in pythonish "" dtml

although the code below makes it obvious it should also be stated that
ids are strings.

one caveat, i wouldn't count on the id naming sequence to nesc reflect
the order of the items, as an item maybe deleted etc and have new ones
created which replace them. if you've not going to be deleting items,
another possibility is



another caveat, in a heavily hit site you're going to be generating id
errors(both methods) because one thread will commit a new doc while the
other tries a moment later to commit with the same id. hence the reason
why i would just use a random int like 

kapil


jensebaer wrote:
> 
> Hi,
> 
> it is not tested but may it works
> 
>  
>   = newid">
> 
>   
> 
> 
> Your new id is: 
> 
> may you have to use _.string.atoi(id) instead _.int(id)
> 
> Viel Glück
> 
> Jens
> 
> - Original Message -
> From: "Patrick Koetter" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, October 16, 2000 2:59 AM
> Subject: [Zope] NEWBIE: assign next free ID automatically
> 
> > Hi,
> >
> > I've been through the Guides, How-Tos and also some of the list-archives.
> > Though I am not a programmer I finally decided to ask that question to all
> > of you...
> >
> > I want to give Users the possibility to add documents in a folder
> >  ;-).
> > so far so good ... Then I want to control the IDs simply by assigning an
> ID
> > to their Form.
> > I found a few articles generating either randomIDs or calculating IDs from
> > ZopeTime().
> >
> > What is it that I want to do?
> > I want to evaluate the highest ID (all are 'int') within the folder and
> > assign the next highest.
> > I'm sure this is easy to you...
> >
> > If there's a RTFM-document I'd be glad to read that.
> >
> > thanks,
> >
> > p@rick
> >
> >
> > ___
> > Zope maillist  -  [EMAIL PROTECTED]
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )
> >
> >
> 
> ___
> Zope maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] List from another list in DTML?

2000-10-15 Thread Kapil Thangavelu

Alexander Chelnokov wrote:
> 
> Hello All,
> 
> A form contains data items ['firstname','secondname','dofb' etc]
> and some "service" fields ['submit','sid','form','nform'].
> With REQUEST.form.items() all these fields are included in a single
> list. How can another list be created from the list which contains
> only data fields? Is it possible with DTML only?

form is an instance of the python cgi FieldStorage the docs included
with your python distro will give you more info.

try (untested)

REQUEST.form.values()

> --
> Best regards,
> Alexander N. Chelnokov
> Ural Scientific Institute of Traumatology and Orthopaedics
> 7, Bankovsky str. Ekaterinburg 620014 Russia
> ICQ: 25640913
> 
> ___
> Zope maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] NEWBIE: assign next free ID automatically

2000-10-15 Thread jensebaer

Hi,

it is not tested but may it works


  = newid">

  


Your new id is: 



may you have to use _.string.atoi(id) instead _.int(id)

Viel Glück

Jens

- Original Message -
From: "Patrick Koetter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 16, 2000 2:59 AM
Subject: [Zope] NEWBIE: assign next free ID automatically


> Hi,
>
> I've been through the Guides, How-Tos and also some of the list-archives.
> Though I am not a programmer I finally decided to ask that question to all
> of you...
>
> I want to give Users the possibility to add documents in a folder
>  ;-).
> so far so good ... Then I want to control the IDs simply by assigning an
ID
> to their Form.
> I found a few articles generating either randomIDs or calculating IDs from
> ZopeTime().
>
> What is it that I want to do?
> I want to evaluate the highest ID (all are 'int') within the folder and
> assign the next highest.
> I'm sure this is easy to you...
>
> If there's a RTFM-document I'd be glad to read that.
>
> thanks,
>
> p@rick
>
>
> ___
> Zope maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>
>

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] NEWBIE: assign next free ID automatically

2000-10-15 Thread Patrick Koetter

Hi,

I've been through the Guides, How-Tos and also some of the list-archives.
Though I am not a programmer I finally decided to ask that question to all
of you...

I want to give Users the possibility to add documents in a folder
 ;-).
so far so good ... Then I want to control the IDs simply by assigning an ID
to their Form.
I found a few articles generating either randomIDs or calculating IDs from
ZopeTime().

What is it that I want to do?
I want to evaluate the highest ID (all are 'int') within the folder and
assign the next highest.
I'm sure this is easy to you...

If there's a RTFM-document I'd be glad to read that.

thanks,

p@rick


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] image attachments in dtml-sendmail and dtml-mime

2000-10-15 Thread Matt

I have benn having a problem with attaching images to a dtml-sendmail.
The following is my dtml code :


To: Feedback Recipient <[EMAIL PROTECTED]>
From: Zope Feedback Form <[EMAIL PROTECTED]>
Subject: Feedback from the web

 Feedback from : Matt


  


 

"paris" is the ID  of an image I uploaded into a node inherited when I
action this dtml document, so there are no key errors or similar.

The result in the email I get is :

 Feedback from : Matt Comments:
Hello there, this is a sample email message for testing.

Content-Type: multipart/mixed;
boundary="127.0.0.1.500.953.971655250.628.16056"


--127.0.0.1.500.953.971655250.628.16056
Content-Type: image/jpeg
Content-Transfer-Encoding: 7bit

http://localhost:8080/admin_test/paris" alt="paris"
height="630" width="472" border="0">

--127.0.0.1.500.953.971655250.628.16056--

I understand that the dtml-mime tag is modifying the action of dtml-var
that follows it, but what I want is the actual text coded binary to be
dumped and not a source tag ... i.e. it's an email, not a webpage.

I thought of embedding that in an external method that returns the text
coded binary w.r.t the encoding type placed in the attributes, but was
wondering if there was a method like this already available, and maybe
not just image centric.

Matt Bion



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] ZClass derrived from Image does not call "view" from within

2000-10-15 Thread Noah

Hi,

I'm a Zope beginner. I'm trying to create an ImageTemplate ZClass. This will work
similar to an Image, but the user can insert it directly in DTML using 
and it will get expanded into HTML (with formatting,  tag, caption, etc.)
This may be long and complicated, but I thought that #4 below was interesting
because it demonstrates how to get at base class methods even if you have
overridden them.

OK, here's the situation:
1. I created a ZClass derived from Image. 
2. I overloaded the index_html to add spit out some HTML instead of the image.
3. If I call an instance of the ZClass directly I get the expected results. 
The index_html is called and I get back some HTML.
Here: http://63.199.26.229:8080/c/gato
4. To get to the image I created an External Method that calls the index_html
method of the my base class (Image):
# I create an External Method called IMG that calls this Python method:
def super_index_html (self):
 for classy in self.__class__.__bases__:
 if classy.__name__ == 'Image':
 return classy.index_html (self, self.REQUEST,\
 self.REQUEST.RESPONSE)
Example: http://63.199.26.229:8080/c/gato/IMG

So far, so good!

Now all I want to do is insert my ZClass in some DTML. Here's what happens:
1. I try to insert in instance of my ZClass into a DTML Method using:

2. The Publisher does not call the view method (index_html) of the object!
Instead it calls str() which is __str__ in Image and that calls Image.tag().
I can't overload __str__ because Zope does not allow a method to start
with _ underscore.

I ran this in the debugger, Publish.publish() (line 173) has this code:
 if result is not response: response.setBody(result)
This is where the trouble begins. setBody() calls str() function on the object.

How do I insert my ZClass into DTML now?

Yours,
Noah



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Re: Zope digest, Vol 1 #1017 - 17 msgs (I will be out of theoffice Monday, October 16th)office Monday, October 16th)

2000-10-15 Thread Darin Lee

I will be out of the office on Monday, October 16. If you require assistance, please 
contact the DEQ helpdesk at 241-7495.






___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] List from another list in DTML?

2000-10-15 Thread Alexander Chelnokov

Hello All,

A form contains data items ['firstname','secondname','dofb' etc]
and some "service" fields ['submit','sid','form','nform'].
With REQUEST.form.items() all these fields are included in a single
list. How can another list be created from the list which contains
only data fields? Is it possible with DTML only?

-- 
Best regards,
Alexander N. Chelnokov
Ural Scientific Institute of Traumatology and Orthopaedics
7, Bankovsky str. Ekaterinburg 620014 Russia
ICQ: 25640913



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )