[Zope] Script timeout

Sukhwinder Singh ssruprai at hotmail.com
Tue May 4 07:34:55 EDT 2004


I want to export about 13000 records from zope db to text file.
But after reading about 7000 it stops and browser shows the message that
site not found etc.

When I use other database with fewer records (about 10000), it works well.

Is the script timing out?
If yes then, is there any way to set the time out period of a script?
Using Zope Management or inside script?

Below is the external method I am using to export data:

def export_pupils(self):
 container = self
 self.REQUEST.RESPONSE.setHeader('Content-Type','text/csv')
 pupils=container.Catalog()
 pupilsData = ""
 rec_count = 0;
 #firstTime = 1
 for pupil in pupils:
  o = pupil.getObject()
  addr = (o.address)
  sdate = "%s" %(o.start_date)
  mdate = "%s" %(o.meeting_date)
  current = "%s" %(o.current)
  base_lesson_hours = "%s" %(o.base_lesson_hours)
  hours_paid_for = "%s" %(o.hours_paid_for)
  no_date_marker = "%s" %(o.no_date_marker)
  address = ""
  for ad in addr:
   address += ad + " "
  pupilsData += o.id + "^^^ " + o.forename + "^^^ " + o.surname + "^^^ " +
address + "^^^ " + o.phone + "^^^ " + o.mobile + "^^^ " + o.comments + "^^^
" + no_date_marker + "^^^ " + sdate + "^^^ " + current + "^^^ " +
o.payment_method + "^^^ " + o.payment_amount + "^^^ "  + o.payment_offer+
"^^^ " +  o.instructor_id + "^^^ " + o.area + "^^^ " + o.advert_id + "^^^ "
+   o.operator_id  + "^^^ " +  o.licence_type + "^^^ "  + base_lesson_hours
+ "^^^ " + mdate + "^^^ "  + o.meeting_time + "^^^ " + o.age_range_text +
"^^^ " + hours_paid_for + "^^^ "  + o.reason_for_leaving + "^^^ " +
o.comment_on_leaving + "^^^ "  + o.surname[0] + "^^^^^\n"
  rec_count = rec_count + 1
  print (rec_count)
  # if firstTime:
  # break
 return pupilsData


If I want to export just current pupils ( current field/variable has 1) how
do I pass that to script (container.Catalog())?



More information about the Zope mailing list