*** J1m_ has quit IRC | 00:39 | |
*** fdrake has quit IRC | 02:10 | |
*** agroszer has joined #zodb | 08:53 | |
*** JaRoel|4D has quit IRC | 08:57 | |
*** JaRoel|4D has joined #zodb | 09:43 | |
*** MtEverest has joined #zodb | 12:57 | |
MtEverest | Hi | 12:57 |
---|---|---|
MtEverest | My question is: | 12:57 |
MtEverest | In a persistent class if I have an attribute which is a simple Python list | 12:58 |
MtEverest | so any changes made to that list will requirep_changed to be set or not | 12:58 |
MtEverest | I mean if my class is persistent then everything inside that is automatically persistent or not | 12:59 |
agroszer | nope, you need to set _p_changed=True | 12:59 |
agroszer | or use PersistentList | 12:59 |
agroszer | instead of a simple [] | 12:59 |
MtEverest | so even if my class is persistent ? | 12:59 |
agroszer | yes, those are the rules | 13:00 |
MtEverest | I have seen some weird behavior...some of my lists are persisted and some of them are not | 13:00 |
agroszer | same goes with a dict or any muteable attribute | 13:00 |
MtEverest | I mean if my list simply consists of strings then it is perissted if my class is a persistent class | 13:00 |
agroszer | yeah because if the object itself gets changed, then tada _p_changed is set | 13:00 |
MtEverest | but if my list consists of some other user defined class instances then it is not | 13:01 |
agroszer | that's not because of that | 13:01 |
MtEverest | then ? | 13:01 |
agroszer | if you set obj.list_attr = [yadayada] | 13:01 |
agroszer | that sets obj._p_changed = True | 13:01 |
MtEverest | yes.. but in both the cases I'm using append | 13:02 |
agroszer | if you do obj.list_attr.append() | 13:02 |
agroszer | that won't set _p_changed | 13:02 |
agroszer | that's how it works | 13:02 |
MtEverest | but if obj is persistent it should copy the whole object again | 13:02 |
agroszer | use simply PersistentList and be done with it | 13:03 |
MtEverest | that is what storage unit section in zodb wikipedia pge says | 13:03 |
MtEverest | every object whose class derives from Persistent is the atomic unit of storage (the whole object is copied to the storage when a field is modified). | 13:03 |
agroszer | http://www.zodb.org/en/latest/documentation/articles/ZODB1.html#detecting-changes | 13:07 |
agroszer | http://www.zodb.org/en/latest/documentation/articles/ZODB1.html#mutable-attributes | 13:07 |
agroszer | use just PersistentList and be done with it | 13:08 |
agroszer | persistent.list.PersistentList it is | 13:08 |
MtEverest | ok, I defined a repoze index on one of the lists and that index doesn't work with persistent objects, I guess.. | 13:09 |
MtEverest | Anyway will change everything and have a relook on this | 13:09 |
MtEverest | thanks agroszer | 13:09 |
agroszer | persistent/non persistent should not be an issue, unless the index looks up the class | 13:10 |
agroszer | because | 13:11 |
agroszer | class PersistentList(UserList, persistent.Persistent): | 13:11 |
MtEverest | ok, will retry | 13:11 |
*** MtEverest has quit IRC | 13:14 | |
*** MtEverest_ has joined #zodb | 13:14 | |
*** MtEverest_ is now known as MtEverest | 13:14 | |
*** MtEverest_ has joined #zodb | 13:18 | |
*** MtEverest has quit IRC | 13:18 | |
*** MtEverest_ is now known as MtEverest | 13:18 | |
*** JaRoel|4D has quit IRC | 13:27 | |
*** JaRoel|4d has joined #zodb | 13:29 | |
*** JaRoel|4d has quit IRC | 13:45 | |
*** JaRoel|4d has joined #zodb | 13:46 | |
*** JaRoel|4d has quit IRC | 13:50 | |
*** yvl has joined #zodb | 14:20 | |
*** yvl has left #zodb | 14:22 | |
*** roelbruggink has joined #zodb | 14:31 | |
*** J1m has quit IRC | 15:37 | |
*** J1m has joined #zodb | 15:40 | |
*** fdrake has joined #zodb | 16:05 | |
*** agroszer has quit IRC | 16:39 | |
*** roelbruggink is now known as JaRoel|4D | 17:38 | |
*** JaRoel|4D has quit IRC | 18:39 | |
*** JaRoel|4D has joined #zodb | 18:39 | |
*** JaRoel|4D has quit IRC | 18:43 | |
*** JaRoel|4D has joined #zodb | 19:26 | |
*** agroszer has joined #zodb | 20:11 | |
*** agroszer has quit IRC | 20:30 | |
J1m | Gaaa, the ZEO stoage server code is just so needlessly inflexible. | 20:32 |
J1m | I'm so sick of writing ZEO tests with multiple processes cuz the storage server can't run in a fricking thread. | 20:33 |
*** JaRoel|4D has quit IRC | 20:43 | |
aclark | J1m: who wrote it? | 21:52 |
J1m | I'd rather not name names. | 21:52 |
aclark | heh | 21:56 |
*** JaRoel|4D has joined #zodb | 23:27 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!