Back to index

plone3  3.1.7
Namespaces | Functions | Variables
wicked.fieldevent Namespace Reference

Namespaces

namespace  interfaces
namespace  meta
namespace  tests
namespace  txtfilter

Functions

def notifyFieldEvent
def render
def store
def at_field_retrieval
def at_field_storage
def test_suite
 testing! ##

Variables

tuple logger = logging.getLogger('wicked.fieldevent')

Function Documentation

def wicked.fieldevent.at_field_retrieval (   field,
  event 
)

Definition at line 39 of file __init__.py.

00039 
00040 def at_field_retrieval(field, event):
00041     return field.get(event.instance, **event.kwargs)
00042 
00043 # @@ separate IATField interfaces?
00044 @implementer(IFieldValueSetter)
@adapter(IField, IFieldStorageEvent)
def wicked.fieldevent.at_field_storage (   field,
  event 
)

Definition at line 45 of file __init__.py.

00045 
00046 def at_field_storage(field, event):
00047     field.set(event.instance, event.value, **event.kwargs)

Definition at line 13 of file __init__.py.

00013 
00014 def notifyFieldEvent(event):
00015     field = event.field
00016     if IFieldRenderEvent.providedBy(event):
00017         event.value = getMultiAdapter((field, event), IFieldValue)
00018         if event.kwargs.get('raw', False) or getattr(event, 'raw', False):
00019             # bail out
00020             return 
00021 
00022     handle(event.field, event.instance, event)
00023     
00024     if IFieldStorageEvent.providedBy(event):
00025         for ignore in subscribers((field, event), IFieldValueSetter):
00026             pass

def wicked.fieldevent.render (   field_,
  instance,
  kwargs 
)

Definition at line 27 of file __init__.py.

00027 
00028 def render(field_, instance, **kwargs):
00029     renderer=FieldRenderEvent(field_, instance, **kwargs)
00030     notify(renderer)
00031     return renderer.value

Here is the caller graph for this function:

def wicked.fieldevent.store (   field_,
  instance,
  value,
  kwargs 
)

Definition at line 32 of file __init__.py.

00032 
00033 def store(field_, instance, value, **kwargs):
00034     store = FieldStorageEvent(field_, instance, value, **kwargs)
00035     notify(store)
00036 
00037 # @@ separate IATField interfaces?
00038 @implementer(IFieldValue)
@adapter(IField, IFieldRenderEvent)

testing! ##

Definition at line 50 of file __init__.py.

00050 
00051 def test_suite():
00052     import unittest
00053     from zope.testing import doctest
00054     from zope.component import provideAdapter, provideHandler
00055     from zope.component import provideSubscriptionAdapter
00056     from zope.testing.cleanup import cleanUp
00057     
00058     def setUp(tc):
00059         # clean slate!
00060         cleanUp()
00061 
00062         # init event system
00063         from zope.component import event
00064         
00065         # register components
00066         provideHandler(notifyFieldEvent)
00067         provideAdapter(at_field_retrieval)
00068         provideSubscriptionAdapter(at_field_storage)
00069 
00070     def tearDown(tc):
00071         cleanUp()
00072         
00073     globs=globals()
00074     globs.update(locals())
00075     
00076     optflags = doctest.REPORT_ONLY_FIRST_FAILURE | doctest.ELLIPSIS
00077     rm = doctest.DocFileTest("README.txt",
00078                              package="wicked.fieldevent",
00079                              globs=globs,
00080                              setUp=setUp,
00081                              tearDown=tearDown,
00082                              optionflags=optflags)
00083     
00084     return unittest.TestSuite((rm,))

Here is the call graph for this function:


Variable Documentation

tuple wicked.fieldevent.logger = logging.getLogger('wicked.fieldevent')

Definition at line 10 of file __init__.py.