Hello list,

I've begun investigating SQLObject for one of my projects but I've encountered several problems.

first the datetime issue:

I naively tried to use a DateTimeCol for a birthday but I keep getting
OverflowError: mktime argument out of range
How should I describe a birthday? Should I use a different type of column?

second is the performance issue...
I have 2 simple structures

class Dates(SQLObject):
    date = StringCol()
    dType = IntCol()
    intervClass = IntCol()
    intervSubClass = StringCol(default=None)
    comments = StringCol()
    patient = ForeignKey('Patients')

class Patient(SQLObject):
    name = StringCol()
    bday = StringCol()
    address = StringCol()
    phone = StringCol()
    comments = StringCol()
    dates = MultipleJoin('Dates')

and a simple select

results = Patient.select()
names = [pac.name for pac in results]

this takes 0.3 seconds... is that normal for something like 2500 patients?

something like
names = [pac.name for pac in results if filter(lambda d: d.dType==3, pac.dates)] takes 35 seconds. Now I do know that the filter should have went into the select but I don't know how to do that...

can someone help ? Any help will do :)

Thank you in advance.

Peter.



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to