Hallo Lars,
so sieht mein Script zum Termineinstellen aus:
events = [
['termin-01','title1','beschreibung1','Ort1','2009-10-27','18:00','2009-10-27','22:00',['Kategorie1','Kategorie1_2']],
['termin-02','title2','
','Ort2','2009-10-27','18:00','2009-10-27','22:00',['Kategorie2','Kategorie2_2']],
]
for l in events:
lid = l[0].replace(' ','-')
container.invokeFactory('Event', id=lid)
container[lid].edit(title=l[1],
description=l[2],location=l[3],start_date=l[4],start_time=l[5],end_date=l[6],stop_time=l[7],eventType=l[8])
container[lid].portal_workflow.doActionFor(container[lid], 'publish')
return "Termine erstellt"
Es gibt eine Variable für das Datum (start_date) und eine für die Zeit
(start_time).
Schönen Gruß
Peter
Lars Walther schrieb:
> Hallo Liste
>
> ich versuche gerade mittels invokeFactory in eine PloneSite eine ganze
> Reihe von Terminen per Script anzulegen:
>
> a=context.invokeFactory(type_name="Event",
> id='myDate',
> title='myTitle',
> start_date='2010/05/03',
> end_date='2010/05/03',
> location='Fuerth')
>
> Das klappt soweit auch einwandfrei. Versuche ich jetzt allerdings, den
> Datumsangaben auch Zeiten mitzugeben, also:
>
> a=context.invokeFactory(type_name="Event",
> id='myDate',
> title='myTitle',
> start_date='2010/05/03
> 10:30:00',
> end_date='2010/05/03
> 16:30:00',
> location='Fuerth')
>
> ...erhalte ich folgenden Fehler beim Auruf des Termins:
>
> ...
> Module Products.PageTemplates.ZRPythonExpr, line 49, in __call__
> - __traceback_info__: not here.start().Date() == here.end().Date()
> Module PythonExpr, line 1, in <expression>
> AttributeError: 'NoneType' object has no attribute 'Date'
>
> Im Catalog sehe ich auch tatsächlich, dass sowohl in start als auch end "None" drinsteht.
> Alle Änderungen des Input-Strings brachen keinen Erfolg,
> also:
> start_date='2010/05/03 10:30'
> start_date='2010/05/03 10:30:00 GMT+1'
> start_date='2010-05-03 10:30:00'
>
> Hat jemand von Euch einen Tipp für mich, vielen Dank.
> Gruss
> Lars
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------
>
>
>
> _______________________________________________
> zope mailing list
>
[hidden email]
>
https://mail.dzug.org/mailman/listinfo/zope_______________________________________________
zope mailing list
[hidden email]
https://mail.dzug.org/mailman/listinfo/zope