Back to index

plone3  3.1.7
Public Member Functions
Archetypes.interfaces._field.IObjectField Class Reference
Inheritance diagram for Archetypes.interfaces._field.IObjectField:
Inheritance graph
[legend]
Collaboration diagram for Archetypes.interfaces._field.IObjectField:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def get
def getRaw
def set
def unset
def getStorage
def setStorage
def getStorageName
def getStorageType
def getContentType
def get_size
def Vocabulary
def copy
def validate
def validate_required
def checkPermission
def checkExternalEditor
def getWidgetName
def getName
def getType
def getDefault
def getAccessor
def getEditAccessor
def getMutator
def toString
def isLanguageIndependent

Detailed Description

Interface for fields that support a storage layer 

Definition at line 151 of file _field.py.


Member Function Documentation

Checks if the user may edit this field and if
external editor is enabled on this instance

Definition at line 106 of file _field.py.

00106 
00107     def checkExternalEditor(instance):
00108         """ Checks if the user may edit this field and if
00109         external editor is enabled on this instance
00110         """

def Archetypes.interfaces._field.IField.checkPermission (   mode,
  instance 
) [inherited]
Check whether the security context allows the given permission on
the given object.

Arguments:

permission -- A permission name
instance -- The object being accessed according to the permission

Definition at line 95 of file _field.py.

00095 
00096     def checkPermission(mode, instance):
00097         """
00098         Check whether the security context allows the given permission on
00099         the given object.
00100 
00101         Arguments:
00102 
00103         permission -- A permission name
00104         instance -- The object being accessed according to the permission
00105         """

Here is the caller graph for this function:

Return a copy of field instance [PRIVATE]

Consisting of field name and properties dictionary.

Definition at line 75 of file _field.py.

00075 
00076     def copy():
00077         """Return a copy of field instance [PRIVATE]
00078 
00079         Consisting of field name and properties dictionary.
00080         """

Here is the caller graph for this function:

def Archetypes.interfaces._field.IObjectField.get (   instance,
  kwargs 
)
Interface for fields that support a storage layer 
Get the value for this field using the underlying storage [PRIVATE]

Definition at line 155 of file _field.py.

00155 
00156     def get(instance, **kwargs):
00157         """Get the value for this field using the underlying storage [PRIVATE]
00158         """

Here is the caller graph for this function:

Get size of the stored data used for get_size in BaseObject

Should be overwritte by special fields like FileField. It's safe for
fields which are storing strings, ints and BaseUnits but it won't return
the right results for fields containing OFS.Image.File instances or
lists/tuples/dicts.

Definition at line 200 of file _field.py.

00200 
00201     def get_size(instance):
00202         """Get size of the stored data used for get_size in BaseObject
00203         
00204         Should be overwritte by special fields like FileField. It's safe for
00205         fields which are storing strings, ints and BaseUnits but it won't return
00206         the right results for fields containing OFS.Image.File instances or
00207         lists/tuples/dicts.
00208         """

Here is the caller graph for this function:

def Archetypes.interfaces._field.IField.getAccessor (   instance) [inherited]
Return the accessor method for getting data out of this
field

Definition at line 125 of file _field.py.

00125 
00126     def getAccessor(instance):
00127         """Return the accessor method for getting data out of this
00128         field"""

def Archetypes.interfaces._field.IObjectField.getContentType (   instance,
  fromBaseUnit = True 
)
Return the mime type of object if known or can be guessed;
otherwise, return None.

Definition at line 196 of file _field.py.

00196 
00197     def getContentType(instance, fromBaseUnit=True):
00198         """Return the mime type of object if known or can be guessed;
00199         otherwise, return None."""

Here is the caller graph for this function:

def Archetypes.interfaces._field.IField.getDefault (   instance) [inherited]
Return the default value to be used for initializing this
field

Definition at line 121 of file _field.py.

00121 
00122     def getDefault(instance):
00123         """Return the default value to be used for initializing this
00124         field"""

Here is the caller graph for this function:

Return the accessor method for getting raw data out of this
field e.g.: for editing

Definition at line 129 of file _field.py.

00129 
00130     def getEditAccessor(instance):
00131         """Return the accessor method for getting raw data out of this
00132         field e.g.: for editing
00133         """

def Archetypes.interfaces._field.IField.getMutator (   instance) [inherited]
Return the mutator method used for changing the value
of this field

Definition at line 134 of file _field.py.

00134 
00135     def getMutator(instance):
00136         """Return the mutator method used for changing the value
00137         of this field"""

Return the name of this field as a string

Definition at line 115 of file _field.py.

00115 
00116     def getName():
00117         """Return the name of this field as a string"""

Here is the caller graph for this function:

def Archetypes.interfaces._field.IObjectField.getRaw (   instance,
  kwargs 
)
Get the raw value for this field using the underlying storage [PRIVATE]

Definition at line 160 of file _field.py.

00160 
00161     def getRaw(instance, **kwargs):
00162         """Get the raw value for this field using the underlying storage [PRIVATE]
00163         """

Return the storage class used in this field [PRIVATE]

Definition at line 175 of file _field.py.

00175 
00176     def getStorage():
00177         """Return the storage class used in this field [PRIVATE]
00178         """

Return the storage name that is configured for this field
as a string

Definition at line 189 of file _field.py.

00189 
00190     def getStorageName(instance=None):
00191         """Return the storage name that is configured for this field
00192         as a string"""

Return the type of the storage of this field as a string

Definition at line 193 of file _field.py.

00193 
00194     def getStorageType(instance=None):
00195         """Return the type of the storage of this field as a string"""

Return the type of this field as a string

Definition at line 118 of file _field.py.

00118 
00119     def getType():
00120         """Return the type of this field as a string"""

Return the widget name that is configured for this field as
a string

Definition at line 111 of file _field.py.

00111 
00112     def getWidgetName():
00113         """Return the widget name that is configured for this field as
00114         a string"""

Get the language independed flag for i18n content (used by LinguaPlon)

Definition at line 146 of file _field.py.

00146 
00147     def isLanguageIndependent(instance):
00148         """Get the language independed flag for i18n content (used by LinguaPlon)
00149         """
00150 

def Archetypes.interfaces._field.IObjectField.set (   instance,
  value,
  kwargs 
)
Set the value for this field using the underlying storage [PRIVATE]

Definition at line 165 of file _field.py.

00165 
00166     def set(instance, value, **kwargs):
00167         """Set the value for this field using the underlying storage [PRIVATE]
00168         """

Here is the caller graph for this function:

def Archetypes.interfaces._field.IObjectField.setStorage (   instance,
  storage 
)
Set the storage for this field to the give storage. [PRIVATE]

Values are migrated by doing a get before changing the storage
and doing a set after changing the storage.

The underlying storage must take care of cleaning up of removing
references to the value stored using the unset method.

Definition at line 180 of file _field.py.

00180 
00181     def setStorage(instance, storage):
00182         """ Set the storage for this field to the give storage. [PRIVATE]
00183 
00184         Values are migrated by doing a get before changing the storage
00185         and doing a set after changing the storage.
00186 
00187         The underlying storage must take care of cleaning up of removing
00188         references to the value stored using the unset method."""

Utility method for converting a Field to a string [PRIVATE]

For the purpose of comparing fields.  This comparison is used for
determining whether a schema has changed in the auto update
function.  Right now it's pretty crude.

Definition at line 139 of file _field.py.

00139 
00140     def toString():
00141         """Utility method for converting a Field to a string [PRIVATE]
00142 
00143         For the purpose of comparing fields.  This comparison is used for
00144         determining whether a schema has changed in the auto update
00145         function.  Right now it's pretty crude."""

Here is the caller graph for this function:

def Archetypes.interfaces._field.IObjectField.unset (   instance,
  kwargs 
)
Unset the value for this field using the underlying storage [PRIVATE]

Definition at line 170 of file _field.py.

00170 
00171     def unset(instance, **kwargs):
00172         """Unset the value for this field using the underlying storage [PRIVATE]
00173         """

def Archetypes.interfaces._field.IField.validate (   value,
  instance,
  errors = {},
  kwargs 
) [inherited]
Validate passed-in value using all field validators.

Return None if all validations pass; otherwise, return failed
result returned by validator

Definition at line 81 of file _field.py.

00081 
00082     def validate(value, instance, errors={}, **kwargs):
00083         """Validate passed-in value using all field validators.
00084 
00085         Return None if all validations pass; otherwise, return failed
00086         result returned by validator
00087         """

Here is the caller graph for this function:

def Archetypes.interfaces._field.IField.validate_required (   instance,
  value,
  errors 
) [inherited]
Validate the required flag for a field [PRIVATE]

Overwrite it in your field for special case handling like empty files

Definition at line 89 of file _field.py.

00089 
00090     def validate_required(instance, value, errors):
00091         """Validate the required flag for a field [PRIVATE]
00092 
00093         Overwrite it in your field for special case handling like empty files
00094         """

def Archetypes.interfaces._field.IField.Vocabulary (   content_instance = None) [inherited]
returns a DisplayList

uses self.vocabulary as source

1) Dynamic vocabulary:

    precondition: a content_instance is given.

    has to return a:
* DisplayList or
* list of strings or
* list of 2-tuples with strings:
    '[("key1","value 1"),("key 2","value 2"),]'

    the output is postprocessed like a static vocabulary.

    vocabulary is a string:
if a method with the name of the string exists it will be called

    vocabulary is a class implementing IVocabulary:
the "getDisplayList" method of the class will be called.


2) Static vocabulary

    * is already a DisplayList
    * is a list of 2-tuples with strings (see above)
    * is a list of strings (in this case a DisplayList with key=value
      will be created)

3) Zope 3 vocabulary factory vocabulary

    - precondition: a content_instance is given
    
    - self.vocabulary_factory is given
    
    - a named utility providing zope.schema.interfaces.IVocbularyFactory 
      exists for the name self.vocabulary_factory.     

Definition at line 31 of file _field.py.

00031 
00032     def Vocabulary(content_instance=None):
00033         """
00034         returns a DisplayList
00035 
00036         uses self.vocabulary as source
00037 
00038         1) Dynamic vocabulary:
00039 
00040             precondition: a content_instance is given.
00041 
00042             has to return a:
00043                 * DisplayList or
00044                 * list of strings or
00045                 * list of 2-tuples with strings:
00046                     '[("key1","value 1"),("key 2","value 2"),]'
00047 
00048             the output is postprocessed like a static vocabulary.
00049 
00050             vocabulary is a string:
00051                 if a method with the name of the string exists it will be called
00052 
00053             vocabulary is a class implementing IVocabulary:
00054                 the "getDisplayList" method of the class will be called.
00055 
00056 
00057         2) Static vocabulary
00058 
00059             * is already a DisplayList
00060             * is a list of 2-tuples with strings (see above)
00061             * is a list of strings (in this case a DisplayList with key=value
00062               will be created)
00063 
00064         3) Zope 3 vocabulary factory vocabulary
00065         
00066             - precondition: a content_instance is given
00067             
00068             - self.vocabulary_factory is given
00069             
00070             - a named utility providing zope.schema.interfaces.IVocbularyFactory 
00071               exists for the name self.vocabulary_factory.     
00072 
00073         """


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