[Zope-dev] CMF attribute horror or too many [t|T]itles
Yo dudes, just a stupid simple question: After wrestling with the documentation, I have created my own CMF content type and it actually works except for some details. In retrospect, it was 90% code browsing, and 10% useful documentation,... cmf is fun, but the cmf dogbowl really sucks .. Anyway, The type I created has a method def Title(self,REQUEST=None): ... and that gets used by some of the skins, The meta data of the object also has an attribute Title, which is used by the Topics for indexing, Now my problem: when a topic lists one of my objects, it lists them with ... . ... but neither my Title() method nor the Meta-data's Title attribute gets to be used. I get an empty string. Where does that one come from ? To make it even more confusing, the object also acquires a title attribute from somewhere higher up the acquisition tree. PS: I noticed the same problem when adding fi a File object through the zope management api instead of the portal management interface. Anyone any clues ? TIA, Sloot. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: Temporary Storage + Sessions + Versions: How?
Chris and Joachim - Maybe this is too simplistic of an approach ... but why not have the session data manager automatically create a new, session data container (temporary storage) for a given zope version. The session data manager can be optimized for the case of no version and then when and if needed create temporary storages on demand for a particular version. - j ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: Temporary Storage + Sessions + Versions: How?
> - I have an index_html method that calls an "initializeSession" method at > the beginning to initialize certain session variables. (Is there another way > to do this?) Yes, you can use an "script to call when objects are added" method in the transient data container related to the session in order to establish default values. > - As the new sessioning code seems to be working within the transaction > machinery, the SESSION.set action causes the mere display of an index_html > page (that includes a session initialization method) to be added to the undo > logs The start of a session or changes to the session namespace cause writes to the database in which the data container related to the session is stored. This is the essence of how the sessioning stuff works. > Strictly speaking, this behaviour might be correct, as the SESSION.set > indeed changes stuff. But it just isn't usable like that. How am I supposed > to use sessions together with versioning at all if I can't even temporarly > set session keys without getting them committed in a transaction? I suspect you're the first person to connect this phenomea with sessions, but it has precedent (see below). > I think that sessions have to act like a temporary, volatile namespace, > something like the REQUEST namespace, but persistent for the time of the > session. This is what they are, you've just run in to a limitation of sessions in conjunction with versions. Was your data container stored in the "main" database? It sounds like it was, but you didn't say. > Chris, in your first response you said that there might be usage > patterns where people want sessions to be version-aware (or let's put it > more general: transaction-aware). But I think that is not quite true: If I > want something like that, I can use plain properties and store them in an > object. I dont think I understand. Can you explain more? > Finally, let me state what I think is a fact: As of Zope 2.5 b3, you can > either use versions OR sessions. If you try to combine them, you'll get into > big trouble. This is a major bug, right? This depends on your definition of major. FWIW, the same problem happens with methods that Catalog writes in conjunction with versions. You get items "stuck" with a version lock error outside of the version -- objects that you didn't "expect" to be locked. Versions are pretty evil in some ways, this being one. What you're encountering is arguably more a bug in versions that a bug in sessions. Someone operating in a version believes that they are not effecting the site in any way whatsoever, and this is just not true -- what they do impacts the site greatly. Versions are very enticing and mostly a lie. ;-) That said, I agree that versions w/ sessions are a "gotcha" waiting to happen, although I wouldn't agree that it's a bug. Short of rewriting the version code, I think maybe writing a storage that "pretended" to be in a version instead of actually being in one is probably the right answer. This could be a modification to TemporaryStorage or it could be an entirely new storage. However, I think we'd need to consider what the flip side of this carefully. I wouldn't want to err on the side of "magic" in this way without considering the impact. - C ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: Temporary Storage + Sessions + Versions: How?
I have a slight correction to make (which doesn't change the message of this posting): > - As the new sessioning code seems to be working within the transaction > machinery, the SESSION.set action causes the mere display of an index_html > page (that includes a session initialization method) to be added to the undo > logs This happens only if I use an undoable session data storage. But if I DON'T, sessions and versions will not work together at all. So that makes no great difference ... ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: Temporary Storage + Sessions + Versions: How?
Hi! I'm still having problems with the sessions. And I am beginning to think that it's not me that is wrong, but the sessioning code has a major conceptial flaw: - I have an index_html method that calls an "initializeSession" method at the beginning to initialize certain session variables. (Is there another way to do this?) - As the new sessioning code seems to be working within the transaction machinery, the SESSION.set action causes the mere display of an index_html page (that includes a session initialization method) to be added to the undo logs - If we use versions at the same time, the index_html method gets locked - After leaving the version, my index_html method causes a version lock error! Strictly speaking, this behaviour might be correct, as the SESSION.set indeed changes stuff. But it just isn't usable like that. How am I supposed to use sessions together with versioning at all if I can't even temporarly set session keys without getting them committed in a transaction? I think that sessions have to act like a temporary, volatile namespace, something like the REQUEST namespace, but persistent for the time of the session. Chris, in your first response you said that there might be usage patterns where people want sessions to be version-aware (or let's put it more general: transaction-aware). But I think that is not quite true: If I want something like that, I can use plain properties and store them in an object. Finally, let me state what I think is a fact: As of Zope 2.5 b3, you can either use versions OR sessions. If you try to combine them, you'll get into big trouble. This is a major bug, right? Cheers Joachim - Original Message - From: "Chris McDonough" <[EMAIL PROTECTED]> To: "Joachim Werner" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, January 14, 2002 9:03 PM Subject: Re: [Zope-dev] Re: Temporary Storage + Sessions + Versions: How? > Joachim Werner wrote: > > > Thanks for the hint. I'll try using a versioning storage, though it might be > > rather inefficient I guess? > > > Most (all?) versioning storages are also undoing so you'll be keeping > undo data that will need to be packed away. It's also hard to manage an > undoing mounted storage (no way to pack one from the ZMI). These were > the reasons that TemporaryStorage was written in the first place, of course. > > > I think if one is using two Zope features together that are both scheduled > > to be included for the 2.5 release, there should be no surprises like that > > one. With Core Session Tracking and Zope 2.4 versioning was fine. And all of > > a sudden, it didn't work any more. That CAN indeed be disturbing ... :-( > > Sorry you had problems. Thanks for bringing it to my attention. > > - C > > ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] [Warning] Weird Zope behaviour: int(1200 * 0.20000000000000001) or 1 == -2147483648
ZopeCVS (trunk) from 9.1.2002; Python 2.1.1; Linux 2 I just met really strange behaviour: For testing purposes, I did: export ZODB_READ_ONLY=1 python >>> import Zope This lead to a deadlock in "ThreadLock.acquire". I ran the process in GDB with breakpoints in "ThreadLock.acquire" and "ThreadLock.release". After a while, I get an exception: > File "/home/dieter/Haufe/src/Zope/lib/python/Zope/__init__.py", line 77, in ? >OFS.Application.initialize(c) > File "/home/dieter/Haufe/src/Zope/lib/python/OFS/Application.py", line 316, in >initialize > delNotification = delnotify, limit=limit) > File "/home/dieter/Haufe/src/Zope/lib/python/Products/Transience/Transience.py", >line 114, in __init__ > self._reset() > File "/home/dieter/Haufe/src/Zope/lib/python/Products/Transience/Transience.py", >line 334, in _reset > self._ring = Ring(l, index) > File "/home/dieter/Haufe/src/Zope/lib/python/Products/Transience/Transience.py", >line 479, in __init__ > raise "ring must have at least one element" > ring must have at least one element Analysis reveals, that in "_reset" we have: > (Pdb) p vars(self) > {'_err_margin': 0.20001, 'id': 'session_data', '_delCallback': None, >'title': 'Session Data Container', '_timeout_secs': 1200, '_limit': 1000, >'_addCallback': None, '_resolution_secs': -2147483648} "_resolution_secs" is severely wrong! It was computed by: > t_secs = self._timeout_secs > r_secs = self._resolution_secs = int(t_secs * self._err_margin) or 1 and the result should have been "240" which I get, when I evaluate the expression in "pdb". Some serious bug is lingering here. I expect a memory corruption. Dieter ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Fw: ZODB based Product problem
- Original Message - From: "Antonio Carrasco" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, January 14, 2002 11:51 PM Subject: ZODB based Product problem > Don´t forget. I´m spanish and my english may not be enough good. Have fun > with this e-mail. > > I´ve been a lot of time looking for documentation, studing it and trying to > develop usefull things with ZODB. Here is my problem. > > Well. I´m working in a Product in wich I use a ZODB to store data. I don´t > use Data.fs, I´m trying to use the ZODB with my own file and collection. I > have a product with this properties or attributes: > id: the id of the instance. > title: the title > ZODBFile: The ZODB where the user want to store the data. I use this > name to construct a FileStorage wich is like > '/lib/python/Products/MyZProduct/var/' + ZODBFile + '.fs > colection: The colection inside the ZODBFile. > > When someone wants to add a MyZProduct instance, I show a form to fill this > attributes. Well, the __init__ is like this: > def __init__(self,id,title,ZODBFile,Colection): > self.id=id > self.title=title > self.ZODBFile=ZODBFile > self.Collection=Colection > #Now try to connect to the database > self.colection=FileStorage('/...#and the name of the > ZODBFile > > This last line make the Zope to raise an Error Message in commit in > Connection object. I don´t remember now (I´m not at work), but something > like: > "Attempt to store data from a remote database connection" > > ??. What´s the problem?. May my ZProduct inherit some other Class or > ZClass to be able to store the data?. > > Later I do a self.connection=db.open(). Another problem with this line. I > can´t save in my class attributes this objects. The colection, neither the > connection, and I need both to make the ZODB navigation, and the ZODB open > and close methods. > > If you need more information, I´ll post another more comprensive e-mail. > > Thanks. > Antonio Carrasco > www.grupoiud.com > PD: For spanish people I have written a How-To / Tutorial named > crearUnProducto. > www.zope.org/Members/rociana/misHowTo/crearUnProducto > > ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZODB based Product problem
Don´t forget. I´m spanish and my english may not be enough good. Have fun with this e-mail. I´ve been a lot of time looking for documentation, studing it and trying to develop usefull things with ZODB. Here is my problem. Well. I´m working in a Product in wich I use a ZODB to store data. I don´t use Data.fs, I´m trying to use the ZODB with my own file and collection. I have a product with this properties or attributes: id: the id of the instance. title: the title ZODBFile: The ZODB where the user want to store the data. I use this name to construct a FileStorage wich is like '/lib/python/Products/MyZProduct/var/' + ZODBFile + '.fs colection: The colection inside the ZODBFile. When someone wants to add a MyZProduct instance, I show a form to fill this attributes. Well, the __init__ is like this: def __init__(self,id,title,ZODBFile,Colection): self.id=id self.title=title self.ZODBFile=ZODBFile self.Collection=Colection #Now try to connect to the database self.colection=FileStorage('/...#and the name of the ZODBFile This last line make the Zope to raise an Error Message in commit in Connection object. I don´t remember now (I´m not at work), but something like: "Attempt to store data from a remote database connection" ??. What´s the problem?. May my ZProduct inherit some other Class or ZClass to be able to store the data?. Later I do a self.connection=db.open(). Another problem with this line. I can´t save in my class attributes this objects. The colection, neither the connection, and I need both to make the ZODB navigation, and the ZODB open and close methods. If you need more information, I´ll post another more comprensive e-mail. Thanks. Antonio Carrasco www.grupoiud.com PD: For spanish people I have written a How-To / Tutorial named crearUnProducto. www.zope.org/Members/rociana/misHowTo/crearUnProducto ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: Temporary Storage + Sessions + Versions: How?
Joachim Werner wrote: > Thanks for the hint. I'll try using a versioning storage, though it might be > rather inefficient I guess? Most (all?) versioning storages are also undoing so you'll be keeping undo data that will need to be packed away. It's also hard to manage an undoing mounted storage (no way to pack one from the ZMI). These were the reasons that TemporaryStorage was written in the first place, of course. > I think if one is using two Zope features together that are both scheduled > to be included for the 2.5 release, there should be no surprises like that > one. With Core Session Tracking and Zope 2.4 versioning was fine. And all of > a sudden, it didn't work any more. That CAN indeed be disturbing ... :-( Sorry you had problems. Thanks for bringing it to my attention. - C ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: Temporary Storage + Sessions + Versions: How?
Hi! Thanks for the hint. I'll try using a versioning storage, though it might be rather inefficient I guess? > > As the Temporary Storage is incompatible with versions, it seems to > me that > > I can not at all use any session manipulating code in a method that > might be > > > called under version control. This is very disturbing to me. > > I'm sorry you're disturbed. ;-) I think if one is using two Zope features together that are both scheduled to be included for the 2.5 release, there should be no surprises like that one. With Core Session Tracking and Zope 2.4 versioning was fine. And all of a sudden, it didn't work any more. That CAN indeed be disturbing ... :-( Joachim ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Calling every zoper, newbies to gurus
First, apologies for the cross posting. I need to make sure this gets to as many people as possible, for obvious reasons... Everyone's got grumbles about how zope.org is organised. Now is the time to quit grumbling and do something about it. If you are a newbie or a guru, please take the time to respond to this email! I'm currently in the process of defining requirements for improving the zope.org website. The first part of this process is listening to the key constituencies for the site. Please note, I'm *not* planning on making a new products rating system, or a replacement for the fishbowl: I'm interested in the graphical design and informational content of the site. The questions are intended to help me understand who is using zope.org, how they use it, and what they would like it to be. If you don't want to answer all the questions, that's fine - just one answer is better than none. Reply to this email privately. I won't divulge any of the information to anyone else for any reasons, and the information will only be used to help improve the zope.org website. I will write up a report once I've received enough input, and publish the results online. Thanks for taking the time to help improve the web site... seb -=-=-=-=-=- 1) How did you hear about Zope? 2) Before you used Zope, what were you expecting? 3) How did the zope.org website change this? Did it confirm, exceed or undermine your expectations? 4) Are you: (a) just trying to find out about this zope thing (b) a zope newbie (c) a zoper of moderate ability (d) a zoper of distinction (e) a guru 5) How would you describe your role in your organisation? The following list is for guidance only - try to describe what you do in your own words. (a) developer (b) technology decision maker (c) business decision maker (d) technical architect / technical lead (e) content developer (f) content manager (g) just a hobby 6) (developers only) Give an estimate of your skill level (none, low, medium or high) for the following: (i) Client side development - HTML - Javascript - XML (ii) Server side development - ASP - PHP - ColdFusion - JSP - perl - SQL (iii) Server admin skills - Apache - IIS - mySQL - shell - postgres - oracle - ms sql server 7) Have you ever used the following products? - broadvision - vignette - interwoven - spectra - midguard - phpnuke - cocoon - mediasurface 8) Which of the technologies mentioned in questions 6 and 7 do you see as closest to Zope? (You can name more than one) 9) What is your preferred operating system? 10) If you could make one piece of information easier to find on zope.org, what would it be? 11) Graphically, what would you expect from a site like zope.org? Give examples from other sites, if possible. 12) Give 3 adjectives which describe the current zope.org website 13) Give 3 adjectives which describe how you'd like it to be 14) How often do you visit the zope.org website? 15) Which part of the current site do *you* find the most useful? 16) Give the current zope.org website a score between 1 and 10 (1=completely useless; 3=pretty bad 5=just about usable 7=pretty good 10=my favourite site) 17) Would you be happy for me to contact you again for more detail (I'm thinking of further emails or IRC sessions)? 18) Any other comments? ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Bug Or Feature in ZopeSplitter
I hope the changes I made will work. :) mfg as Chris McDonough schrieb: > > This is correct. The current splitter implementation ignores digits. > You can make your own implementation that does not. > > Andre Schubert wrote: > > > Hi all, > > > > After playing with Zope 2.4.3 and TextIndexes i found out that the > > TextIndex does not Index Digits( "12345" ). > > Thatswhy i looked in the sources and i saw in "next_word", that there is > > the caracter checked with "isalnum", but in "check_synstop" the caracter > > is checked with "isalpha"? > > This means to me that every DIGIT is a stop-word and not a real > > character. > > > > If have changed the isalpha with isalnum and it seems to work... > > > > Can anyone explain this... > > > > thanks as > > > > ___ > > Zope-Dev maillist - [EMAIL PROTECTED] > > http://lists.zope.org/mailman/listinfo/zope-dev > > ** No cross posts or HTML encoding! ** > > (Related lists - > > http://lists.zope.org/mailman/listinfo/zope-announce > > http://lists.zope.org/mailman/listinfo/zope ) > > > > ___ > Zope-Dev maillist - [EMAIL PROTECTED] > http://lists.zope.org/mailman/listinfo/zope-dev > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: Temporary Storage + Sessions + Versions: How?
Joachim Werner wrote: > As the Temporary Storage is incompatible with versions, it seems to me that > I can not at all use any session manipulating code in a method that might be > called under version control. This is very disturbing to me. I'm sorry you're disturbed. ;-) > Are there any workarounds like temporarly switching off versioning before > the SESSION.set is called? Not really. > I guess the best fix would be if Temporary Storage would actually work with > versions. This would mean to me that it should gracefully ignore the fact > that we are working in a version. You're right, TemporaryStorage should really support versions. But it doesn't; there wasn't enough time. :-( Maybe in the future, but no promises. Note that you can put the data container in a versioning storage and get around this problem now. Re: TemporaryStorage ignoring versions. I think this might be OK for some pattern of usage. However, I can imagine receiving another email from somebody saying "how dare your sessions ignore versions; this has really messed me up and you've destroyed my project". ;-) I'd probably accept a patch however that allowed you to set an environment variable to control this behavior. Thanks! - C ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Temporary Storage + Sessions + Versions: How?
Hi! I have a problem concerning using versions and sessions together in Zope 2.5 beta 3: As the Temporary Storage is incompatible with versions, it seems to me that I can not at all use any session manipulating code in a method that might be called under version control. This is very disturbing to me. Are there any workarounds like temporarly switching off versioning before the SESSION.set is called? I guess the best fix would be if Temporary Storage would actually work with versions. This would mean to me that it should gracefully ignore the fact that we are working in a version. Joachim ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Bug Or Feature in ZopeSplitter
This is correct. The current splitter implementation ignores digits. You can make your own implementation that does not. Andre Schubert wrote: > Hi all, > > After playing with Zope 2.4.3 and TextIndexes i found out that the > TextIndex does not Index Digits( "12345" ). > Thatswhy i looked in the sources and i saw in "next_word", that there is > the caracter checked with "isalnum", but in "check_synstop" the caracter > is checked with "isalpha"? > This means to me that every DIGIT is a stop-word and not a real > character. > > If have changed the isalpha with isalnum and it seems to work... > > Can anyone explain this... > > thanks as > > ___ > Zope-Dev maillist - [EMAIL PROTECTED] > http://lists.zope.org/mailman/listinfo/zope-dev > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope ) > ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Bug Or Feature in ZopeSplitter
Hi all, After playing with Zope 2.4.3 and TextIndexes i found out that the TextIndex does not Index Digits( "12345" ). Thatswhy i looked in the sources and i saw in "next_word", that there is the caracter checked with "isalnum", but in "check_synstop" the caracter is checked with "isalpha"? This means to me that every DIGIT is a stop-word and not a real character. If have changed the isalpha with isalnum and it seems to work... Can anyone explain this... thanks as ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] modify modification time of an object inside a product
dear zope gurus, i hope, this is the right place to post this: i'm trying to modify a modified ZSyncer product. The first modification implements bidirectional syncronisation. It simply exports any Zope object, transmitts it via XML-RPC and imports it remotely, or vice versa. The problem i'm trying to fix is that synced objects should have synced timestamps and not the original one vs. the importation time. My solution is to *ship* the modification time of the original object together with the object, but i don't know how to explicitly change the timestamp of the freshly imported one. the essential part of the code is the following method, which imports the object -- it gets the object data, the path of the object and its modification time (see "# change modification time"): def manage_addXMLRPC(self, data, obj_path, mod_time=0, add_in=1): """ Adds / imports an object """ # make sure we always get a string or a list if type(obj_path) == type('string'): obj_path = string.split(obj_path, '/') # object lets try finding the parent try: parent = self.restrictedTraverse(obj_path[:-1]) except KeyError: return 404 # lets check they are allowed to do this c = getSecurityManager().checkPermission allowed = 1 for perm in ['Delete objects', 'Import/Export objects']: if not c(perm, parent): allowed = 0 if not allowed: return 403 # if there is one there already, delete it if obj_path[-1] in parent.objectIds(): parent.manage_delObjects([obj_path[-1],]) # lets do it if add_in: # fake a file using StringIO file = StringIO() file.write(self._decode(data)) file.seek(0) # now import new = parent._p_jar.importFile(file) parent._setObject(new.getId(), new) # change modification time my_obj = self.restrictedTraverse(obj_path) my_obj._p_mtime = mod_time # yay! return 200 i tryed to change the modification time via the _p_mtime attribute (because bobobase_modification_time() returns it normally), but it doesn't work. I played around with it but there was no enlightenment. i guess its a secret of the ZODB. please help me to get on the right path. yours faithfully. Andreas Hoelzl ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )