On Aug 4, 2006, at 1:45 AM, OriginalBrownster wrote:
> How would I add an entry to the database for the class shown below
> through the shell
> for filename and abspath
>
> class UploadedFile(SQLObject):
>       filename = StringCol(alternateID=True)
>       abspath = StringCol(length=255)

SQLObject provides a constructor for your SO classes so you can set  
the column's values when initializing your instances, use it like:

file = UploadedFile(filename="photo.jpg", abspath="/images/photo.jpg")

Note that this statement actually creates a record in the database  
once you commit with your transaction (if db supports it) with  
"hub.commit()" or by answering "yes" when asked to do so when leaving  
the shell.

HTH,
Alberto

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to