I think Jorge is talking about the BLOBCol[1]. I've used it for
storing files in the database before, although I would have prefered
to use the filesystem for storage.
I would suggest that you create two tables. One with the file
information (i.e. filename, size, filetype and any
foreignkey/multiplejoin columns) and one with the actual file data
using a SingleJoin column.
This will prevent you from pulling out the file data (which may become
quite large in some cases) every time you want to access only the
file's name/size/etc. The only time you actually want the data itself
is when you serve the file to the client. This change increased
performance of my app by a significant amount. Example:
class FileMeta(SQLObject):
filename = UnicodeCol(length=255)
size = IntCol()
user = ForeignKey("User")
data = SingleJoin("FileData")
class FileData(SQLObject):
data = BLOBCol()
meta = ForeignKey("FileMeta")
Note: I re-wrote this from memory in gmail, so forgive me if it's not 100%.
Hope this helps,
Lee
[1]: http://www.sqlobject.org/SQLObject.html#column-types
--
Lee McFadden
blog: http://www.splee.co.uk
work: http://fireflisystems.com
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---