how to modify documents creation date
Hello, I need to modify the creation date of several documents: most of them a news, so I have to insert/modify to make them appear to bo created some time ago. Someone told me it can't be done in plone or zmi, but using scripting: ok, I believe it, but I think it's quite strange that no one else had to insert an old (forgotten) news in a plone site. Thanks in advance. zenobito. p.s.: I have zope 2.7.2, plone 2.0.5, ubuntu linux.
Zope objects don't have a creation date, but they have a modification date which is called bobobase_modification_time which is a callable function. This can't be modified as far as I know other than setting this date to todays date and time. Don't rely on this date for anything. You're better off setting your own date on every object. How you do this depends but if you use Plone it shouldn't be hard if you use archetypes. On 2/5/06, zenobito zenobito <zenobito@gmail.com> wrote:
Hello, I need to modify the creation date of several documents: most of them a news, so I have to insert/modify to make them appear to bo created some time ago. Someone told me it can't be done in plone or zmi, but using scripting: ok, I believe it, but I think it's quite strange that no one else had to insert an old (forgotten) news in a plone site. Thanks in advance.
zenobito.
p.s.: I have zope 2.7.2, plone 2.0.5, ubuntu linux. _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Peter Bengtsson wrote:
Zope objects don't have a creation date, but they have a modification date which is called bobobase_modification_time which is a callable function. This can't be modified as far as I know other than setting this date to todays date and time. Don't rely on this date for anything.
You're better off setting your own date on every object. How you do this depends but if you use Plone it shouldn't be hard if you use archetypes.
Stock CMF content stores the creation data in a separate attribute, 'creation_data'. That attribute has mo "mutator" method, and therefore cannot be assigned by untrusted code. You should be able to set the value from an ExternalMethod, however. Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFD5gie+gerLs4ltQ4RArsVAJ4iP3IKk/31sT7dtHV+uWI0KjY6ogCfRmv8 TaGFYBvUp1sMReh7/oEE9Dc= =bsaj -----END PGP SIGNATURE-----
--On 5. Februar 2006 09:15:58 -0500 Tres Seaver <tseaver@palladion.com> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Peter Bengtsson wrote:
Zope objects don't have a creation date, but they have a modification date which is called bobobase_modification_time which is a callable function. This can't be modified as far as I know other than setting this date to todays date and time. Don't rely on this date for anything.
You're better off setting your own date on every object. How you do this depends but if you use Plone it shouldn't be hard if you use archetypes.
Stock CMF content stores the creation data in a separate attribute, 'creation_data'. That attribute has mo "mutator" method, and therefore cannot be assigned by untrusted code. You should be able to set the value from an ExternalMethod, however.
Since the original posting was a cross-posting from the plone-users list I assume that we are talking about a Plone specific issue. And ATContentTypes defines the setCreationDate() mutator for that...but I explained that to the asker already two times but he seems to death on both ears :-/ -aj
participants (4)
-
Andreas Jung -
Peter Bengtsson -
Tres Seaver -
zenobito zenobito