Il giorno 12 dicembre 2009 09.39, Gianpiero Campanella < [email protected]> ha scritto:
> > > Il giorno 11 dicembre 2009 18.21, Fabrizio Rota <[email protected]>ha > scritto: > > Con il codice di ploneformgen >> >> anno_intero = form['data-emissione'].year() >> anno = str(anno_intero) >> >> (ove data-emissione è un campo pfg di tipo "data") ho l'errore >> >> Exception Type AttributeError Exception Value 'str' object has no >> attribute 'year' >> > > I consigli che hai ricevuto vanno tutti bene. Devi solo aggiungere qualcosa > del tipo: > > from DateTime import DateTime > > anno_interno = DateTime(form['data-emissione']).year() > anno = str(anno_intero) > > Ciao. > > > Sottoscrivo. Aggiungo che se sei in un python script non c'e' neanche bisogno di importare DateTime. Lo usi come metodo built-in. bye -- bye SauZheR ************************************ l'iterazione è umana... la ricorsione, Divina! ************************************ reply to: sauzher AT gmail DOT com
_______________________________________________ Plone-IT mailing list [email protected] http://lists.plone.org/mailman/listinfo/plone-it http://www.nabble.com/Plone---Italy-f21728.html
