[Product-Developers] Re: Python content type creation

Raphael Ritz r.ritz at biologie.hu-berlin.de
Sat Jul 11 20:09:08 UTC 2009


Françoise Conil wrote:
> Looking at ATContentTypes/content/event.py , cmf_edit method has not 
> modification_date or subject parameter.

But the strange thing here is that cmf_edit get's called at all.
IIRC that's just for backwards compatibility with the old CMF
API. Archetypes and ATContentTypes usually use the more generic
edit/update methods which handle all schema attributes just fine.

Raphael


> 
> The error with invokeFactory seems logic
> 
>     def cmf_edit(self, title=None, description=None, eventType=None,
>              effectiveDay=None, effectiveMo=None, effectiveYear=None,
>              expirationDay=None, expirationMo=None, expirationYear=None,
>              start_date=None, start_time=None, startAMPM=None,
>              end_date=None, stop_time=None, stopAMPM=None,
>              location=None,
>              contact_name=None, contact_email=None, contact_phone=None,
>              event_url=None):
> 
> This is perhaps the answer to my question : Which parameters can be 
> passed to invokeFactory ? The parameters of the cmf_edit() method of the 
> content class
> 
> modification_date should be set by the ExtensibleMetadata 
> setModificationDate() mutator method
> subject should be set by the ATEvent setSubject mutator() method
> 
> Finally, I am not sure this needs creating a bug report
> 
>     2009/7/11 Andreas Jung
>     <lists at zopyx.com
>     <mailto:lists at zopyx.com>>
> 
>         On 11.07.09 15:10, Françoise Conil wrote:
> 
>         Not reproducable with my code:
> 
>         from DateTime.DateTime import DateTime
>         context.invokeFactory('Event', id='foo',
>         modification_date=DateTime())
>         return 'one'
> 
>         Feel free filling a bug report.
> 
>         -aj
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> http://lists.plone.org/mailman/listinfo/product-developers





More information about the Product-Developers mailing list