Logo Search packages:      
Sourcecode: zope-archetypes version File versions

Archetypes::Field::ImageField Class Reference

Inheritance diagram for Archetypes::Field::ImageField:

Archetypes::Field::ObjectField Archetypes::Field::Field

List of all members.


Detailed Description

implements an image attribute. it stores
    it's data in an image sub-object

    sizes is an dictionary containing the sizes to
    scale the image to. PIL is required for that.

    Format:
    sizes={'mini': (50,50),
           'normal' : (100,100), ... }
    syntax: {'name': (width,height), ... }

    the scaled versions can then be accessed as
    object/<imagename>_<scalename>

    e.g. object/image_mini

    where <imagename> is the fieldname and <scalename>
    is the name from the dictionary

    original_size -- this parameter gives the size in (w,h)
    to which the original image will be scaled. If it's None,
    then no scaling will take place.
    This is important if you don't want to store megabytes of
    imagedata if you only need a max. of 100x100 ;-)

    max_size -- similar to max_size but if it's given then the image
                is checked to be no bigger than any of the given values
                of width or height.
                XXX: I think it is, because the one who added it did not
                document it ;-) (mrtopf - 2003/07/20)

    example:

    ImageField('image',
        original_size=(600,600),
        sizes={ 'mini' : (80,80),
                'normal' : (200,200),
                'big' : (300,300),
                'maxi' : (500,500)})

    will create an attribute called "image"
    with the sizes mini, normal, big, maxi as given
    and a original sized image of max 600x600.
    This will be accessible as
    object/image

    and the sizes as

    object/image_mini
    object/image_normal
    object/image_big
    object/image_maxi

    Scaling will only be available if PIL is installed!

    If 'DELETE_IMAGE' will be given as value, then all the images
    will be deleted (None is understood as no-op)
    

Definition at line 986 of file Field.py.


Public Member Functions

def __init__
def __repr__
def checkExternalEditor
def checkPermission
def copy
def get
def getAccessor
def getContentType
def getDefault
def getEditAccessor
def getMutator
def getName
def getRaw
def getStorage
def getStorageName
def getStorageType
def getType
def getWidgetName
def scale
def set
def setStorage
def toString
def unset
def validate
def Vocabulary

Public Attributes

 storage
 validators
 widget

Static Public Attributes

string default_view = "view"
tuple security = ClassSecurityInfo()

Static Private Attributes

tuple __implements__ = ObjectField.__implements__+(IImageField,)
tuple _properties = Field._properties.copy()

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index