Back to index

plone3  3.1.7
Classes | Functions | Variables
CMFDefault.File Namespace Reference

Classes

class  File

Functions

def addFile

Variables

tuple FileFactory = Factory(File)

Function Documentation

def CMFDefault.File.addFile (   self,
  id,
  title = '',
  file = '',
  content_type = '',
  precondition = '',
  subject = (),
  description = '',
  contributors = (),
  effective_date = None,
  expiration_date = None,
  format = 'text/html',
  language = '',
  rights = '' 
)
Add a File

Definition at line 55 of file File.py.

00055 
00056            ):
00057     """
00058     Add a File
00059     """
00060 
00061     # cookId sets the id and title if they are not explicity specified
00062     id, title = OFS.Image.cookId(id, title, file)
00063 
00064     self=self.this()
00065 
00066     # Instantiate the object and set its description.
00067     fobj = File( id, title, '', content_type, precondition, subject
00068                , description, contributors, effective_date, expiration_date
00069                , format, language, rights
00070                )
00071 
00072     # Add the File instance to self
00073     self._setObject(id, fobj)
00074 
00075     # 'Upload' the file.  This is done now rather than in the
00076     # constructor because the object is now in the ZODB and
00077     # can span ZODB objects.
00078     self._getOb(id).manage_upload(file)
00079 


Variable Documentation

Definition at line 252 of file File.py.