00:07.02 | weatherman | storm/store-name r173 committed by jkakar@kakar.ca |
00:07.02 | weatherman | - Refactored ZStorm.iterstores to use _name_index (niemeyer-2). |
00:14.39 | weatherman | storm/store-name r174 committed by jkakar@kakar.ca |
00:14.40 | weatherman | - Use weak references where possible (niemeyer-1). |
00:18.44 | *** join/#storm jml (n=jml@ppp121-44-210-95.lns1.hba1.internode.on.net) |
01:21.44 | tjs | so I have a storm class which has an __name__ attribute which is a Unicode() descriptor |
01:22.23 | tjs | the line is actaully: __name__ = Unicode(default=u"No Name") |
01:22.31 | tjs | which is on a base class |
01:22.45 | tjs | I subclass this base class, and create one |
01:23.07 | tjs | the column contains NULL for a start |
01:23.20 | tjs | (shouldn't this be 'No Name' ?) |
01:23.58 | tjs | and when I try to access it from the debugger (in a zope process) I get: (Pdb) context.__name__ |
01:24.01 | tjs | *** KeyError: <storm.properties.PropertyColumn object at 0xb03e154c> |
01:35.02 | radix | tjs: by the way, I noticed some of your comments from last night |
01:35.12 | radix | tjs: I really don't understand why you'd want __name__ = Unicode() |
01:35.22 | radix | tjs: is __name__ something that Zope gets, sets, or both? |
01:35.28 | tjs | both |
01:35.54 | radix | tjs: and you want to store this value in the database? do you already have a column that you'd like the value to be? |
01:36.11 | tjs | nope |
01:36.23 | radix | tjs: I'm also beginning to think that maybe you want to be using an interface at a different layer; you don't really need to deal with this rubbish if you don't, if you use the low level traversal API... |
01:36.25 | tjs | I've added a __name__ column |
01:36.42 | radix | *if you don't want to |
01:36.43 | tjs | radix: yeh? |
01:36.57 | radix | well, if I understand correctly, which I may not |
01:37.06 | tjs | radix: I still need to maintain a heirarchy |
01:37.22 | tjs | which my Folder class does happily with a Crossref() attribute |
01:37.27 | tjs | and a dict of keys |
01:37.48 | radix | but I certainly never had to deal with it, using the IBrowserPublisher interfac |
01:37.49 | radix | e |
01:38.01 | tjs | problem is I -must- support the ZMI views :/ |
01:38.05 | radix | oh |
01:38.07 | tjs | not just containment |
01:38.11 | radix | I guess that is a different kind of hierarchy |
01:38.20 | tjs | yeh |
01:38.24 | radix | What interface is __name__ a part of? |
01:38.50 | tjs | ILocation |
01:39.05 | tjs | and IContained (which just subclasses ILocation) |
01:40.32 | tjs | I think the crazy '*** FooException' errors are comming out of the security manager |
01:40.45 | radix | jesus that is a horrible interface |
01:40.53 | tjs | heh, feel my pain |
01:41.45 | radix | I guess you implement the setting of __parent__ with some descriptor that does something like set a parent_id? |
01:41.51 | radix | I guess it could be a Reference |
01:43.00 | tjs | its a Crossref descriptor |
01:43.17 | tjs | which is my own crazy 'lets keep references to anything anywhere' thingo |
01:43.20 | radix | right, ok |
01:44.27 | tjs | hm |
01:45.20 | tjs | so I create an object in the zmi (that is a storm object, with the __name__ = Unicode(default=u"no Name")) |
01:45.34 | tjs | and in the db I get NULL in the __name__ column |
01:45.55 | tjs | what happened to my default? let alone it being set by zope |
01:46.47 | radix | hm |
01:47.11 | radix | are you sure you're seeing the same object in the database? |
01:47.16 | radix | is there some other primary key? |
01:47.37 | radix | you might want to set allow_none=False |
01:47.41 | tjs | __name__ is not the primary key |
01:47.44 | radix | maybe you'll find out who's setting it to None |
01:48.00 | tjs | allow_none on the class? |
01:48.08 | radix | in Unicode() |
01:48.16 | radix | Unicode(allow_none=False, default=u"no name")) |
01:48.16 | tjs | ah ok |
01:48.18 | radix | s/))/) |
01:50.20 | *** join/#storm jml (n=jml@ppp108-61.static.internode.on.net) |
01:50.44 | tjs | hork |
01:50.58 | tjs | ok, new object, still NULL |
01:51.05 | tjs | its not getting set |
01:51.34 | radix | and no python traceback!? |
01:51.36 | tjs | deven with the default |
01:51.38 | tjs | nope |
01:51.42 | radix | ok, so uh |
01:51.45 | tjs | s/dev/ev |
01:51.47 | radix | maybe the schema should say NOT NULL :) |
01:52.13 | radix | just an idea, but hopefully you'll see an error *somewhere* if you do that |
01:52.13 | tjs | that should not matter if there is a value to be set though? |
01:52.17 | tjs | ok |
01:52.21 | tjs | sec |
01:52.47 | tjs | did you know that rolled back transactions consume auto incrementing ids ? |
01:52.55 | tjs | just an asside |
01:52.58 | tjs | :) |
01:54.07 | radix | I was a bit surprised to see that |
01:54.11 | radix | but I guess it's not really a big deal |
01:54.15 | radix | or at least it shouldn't be :) |
01:54.26 | radix | actually, was I surpriseD? |
01:54.28 | radix | maybe I'm not |
01:54.34 | radix | I'm trying to remember about the first time I heard about that ;) |
01:54.41 | radix | it definitely is the only thing that makes sense |
01:58.14 | tjs | argh I'm a spaz |
01:58.18 | tjs | edited the wrong table |
01:58.20 | tjs | sec |
02:02.35 | tjs | radix: http://rafb.net/p/oUfVoP90.html |
02:03.09 | radix | huh |
02:03.13 | radix | that looks like an empty string |
02:03.56 | tjs | yeh it is now |
02:04.04 | tjs | after adding the NOT NULL |
02:04.29 | tjs | its still not the default |
02:05.50 | tjs | http://rafb.net/p/OVGQb328.html |
02:06.01 | tjs | ^^ the classes in question, from various modules |
02:06.14 | tjs | the last one is the folder I'm adding |
02:22.04 | tjs | radix: *argh* |
02:22.26 | tjs | ok I dropped a set_trace in storm.properties.Property.__set__ |
02:22.34 | tjs | then created an object |
02:22.51 | tjs | the table gets populated with the table defaults |
02:23.00 | tjs | __set__ does not get called at all |
02:29.52 | tjs | lunching |
04:17.06 | *** join/#storm oubiwann (n=oubiwann@c-75-71-99-53.hsd1.co.comcast.net) |
04:52.43 | tjs | is there some way to use a different column name for an attribute than the attribute's name? |
04:53.23 | tjs | ie: flibble = Int(really_use_column="blibble") |
04:56.16 | tjs | oh |
04:56.17 | tjs | name |
04:56.20 | tjs | *halo* |
04:56.23 | jkakar | tjs: I'm not sure if this'll work, but you can pass name I think. |
04:56.26 | jkakar | tjs: D'oh. |
04:56.30 | jkakar | tjs: Perfect timing. ;) |
04:56.41 | tjs | :) |
04:57.04 | tjs | storm freaks out if I make a property called __name__ |
04:57.13 | tjs | I can have __anythingelse__ |
05:19.27 | jkakar | Oh, weird. |
05:21.17 | jkakar | tjs: Is the __name__ you're using clashing with the builtin __class__.__name__, perhaps? |
05:22.15 | tjs | http://rafb.net/p/diFvqQ67.html |
05:22.25 | tjs | jkakar: minimal non-working example |
05:22.31 | tjs | its ok, I got around it |
05:22.46 | tjs | I added a zope_name and made a property for __name__ |
05:23.19 | jkakar | Huh, weird. |
06:21.10 | *** join/#storm jukart (n=jukart@lsfw01.lovelysystems.com) |
07:31.43 | *** join/#storm mcella (n=michele@ip-132-247.sn2.eutelia.it) |
08:09.08 | *** join/#storm Fujitsu (n=fujitsu@ubuntu/member/fujitsu) |
09:15.36 | *** join/#storm jml_ (n=jml@ppp121-44-210-95.lns1.hba1.internode.on.net) |
11:24.29 | *** join/#storm Fujitsu (n=fujitsu@ubuntu/member/fujitsu) |
11:33.11 | *** join/#storm Fujitsu (n=fujitsu@ubuntu/member/fujitsu) |
12:20.02 | *** join/#storm jml (n=jml@ppp121-44-210-95.lns1.hba1.internode.on.net) |
12:37.33 | *** join/#storm niemeyer (n=niemeyer@modemcable178.77-70-69.static.videotron.ca) |
14:25.08 | *** join/#storm rafael (n=rafael@moinmoin/fan/rafael) |
16:47.38 | weatherman | storm/cambridge-storm-talk r175 committed by radix@twistedmatrix.com |
16:47.39 | weatherman | 1:N references |
17:14.51 | weatherman | storm/store-name r175 committed by jkakar@kakar.ca |
17:14.51 | weatherman | - Replace dict with WeakKeyDictionary to ensure Store instances don't |
17:14.51 | weatherman | <PROTECTED> |
18:07.56 | weatherman | storm/store-name r176 committed by jkakar@kakar.ca |
18:07.56 | weatherman | - Merged trunk. |
18:53.58 | *** join/#storm rafael (n=rafael@moinmoin/fan/rafael) |
19:57.28 | *** join/#storm ajmitch (n=ajmitch@ubuntu/member/ajmitch) |
20:11.10 | weatherman | storm/cambridge-storm-talk r176 committed by radix@twistedmatrix.com |
20:11.10 | weatherman | M:N references and very minor refactoring |
21:52.47 | weatherman | storm/cambridge-storm-talk r177 committed by radix@twistedmatrix.com |
21:52.47 | weatherman | add the .odp file for my slides and also tweak the .txt a bit |
22:17.18 | tjs | morning |
22:21.15 | niemeyer | tjs: Morning! |
22:21.56 | tjs | niemeyer: hey :) |
23:10.20 | *** join/#storm jml (n=jml@ppp121-44-210-95.lns1.hba1.internode.on.net) |
23:27.32 | tjs | can default arg be a callable? |
23:27.42 | tjs | that would be kinda nice |
23:28.37 | radix | yes |
23:28.45 | tjs | cool |
23:28.57 | tjs | so DateTime(default=time.now) |
23:29.02 | tjs | or something |
23:29.04 | radix | yep |
23:29.08 | tjs | groovy |
23:35.03 | tjs | er.. |
23:35.12 | tjs | guys |
23:35.21 | tjs | OperationalError: (2006, 'MySQL server has gone away') |
23:35.33 | tjs | ZStorm does not try to reconnect? |
23:37.04 | tjs | that is kinda an issue |