[SQLObject] How to Specify a default value for ForeignKey
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: Asterio G. <ni...@ya...> - 2005-07-22 18:27:10
|
Hi all,
I am trying to set a default value of 'None' for a
ForeignKey attribute, so if the Foreign ID is not
found, value will be None, and avoid the:
....main.py....
if not selectResults:
raise SQLObjectNotFound, "The object
%s by the ID %s does not exist" %
(self.__class__.__name__, self.id)
....Error....
Something like this
parent =
ForeignKey('User',dbName='user_parent',default=None)
do not work
Any ideas?
Thanks
--
Asterio
______________________________________________
Renovamos el Correo Yahoo!
Nuevos servicios, más seguridad
http://correo.yahoo.es
|