00:34.40 | *** join/#storm sidnei (n=sidnei@plone/dreamcatcher) |
01:01.25 | *** join/#storm sidnei_ (n=sidnei@201-15-141-228.cslce701.dsl.brasiltelecom.net.br) |
02:46.40 | *** join/#storm sidnei (n=sidnei@plone/dreamcatcher) |
03:20.41 | *** part/#storm sidnei (n=sidnei@plone/dreamcatcher) |
03:42.31 | *** join/#storm shaunm (n=shaunm@98.212.133.244) |
05:01.28 | *** part/#storm MFen (n=cdodt@demo.goonmill.org) |
05:02.14 | *** join/#storm jukart (n=jukart@d91-128-122-124.cust.tele2.at) |
05:47.41 | *** join/#storm thumper (n=quassel@125-236-193-95.adsl.xtra.co.nz) |
06:07.52 | *** join/#storm jukart (i=lovely@81.189.156.94) |
07:00.54 | *** join/#storm goschtl (n=goschtl@p5B0BF8B1.dip.t-dialin.net) |
11:17.08 | *** join/#storm andrea-bs (n=andrea@ubuntu/member/beeseek.developer.andrea-bs) |
12:29.33 | *** join/#storm niemeyer (n=niemeyer@200-138-37-135.ctame705.dsl.brasiltelecom.net.br) |
14:31.26 | *** join/#storm jdobrien (n=john@70.119.205.238) |
14:31.56 | jdobrien | When accessing a property which is a reference set, what's the best way to create the referenced object automatically when it's accessed? |
14:32.33 | jdobrien | s/reference set/reference |
14:38.38 | *** join/#storm shaunm (n=shaunm@proxyserver.wolfram.com) |
14:41.04 | *** join/#storm andrea-bs (n=andrea@ubuntu/member/beeseek.developer.andrea-bs) |
14:42.51 | jdobrien | niemeyer, radix...is this possible ^^ |
14:43.07 | radix | jdobrien: I don't understand |
14:43.15 | radix | if it's a reference, when you access it, it'll give you an object |
14:43.22 | radix | representing the referenced object |
14:43.45 | jdobrien | hmm |
14:44.16 | jamesh | If you want "create object if it doesn't already exist" behaviour, I'd use a method rather than hiding it behind attribute access. |
14:44.31 | radix | oh |
14:44.35 | jdobrien | jamesh: hmm |
14:44.44 | jdobrien | jamesh: that's kind of the point of hiding it |
14:45.03 | radix | or, create the object when the parent object is constructed |
14:45.13 | jdobrien | radix: that's a good idea |
14:45.19 | jamesh | e.g "bar = foo.ensure_bar()" instead of "bar = foo.bar" |
14:45.50 | jamesh | that'd be good too if you always want the pair of objects. |
14:46.35 | jdobrien | jamesh: we do |
14:47.24 | jdobrien | jamesh: currently I am using properties to do what your saying...but it's ugly |
14:47.55 | jdobrien | you're |
14:47.58 | jamesh | then the constructor seems like a good place to do so. E.g. in Launchpad, the factory function used to create a project also creates the associated default release series |
14:48.20 | jamesh | if you want lazy creation, then I'd go for a method. |
14:48.46 | jdobrien | jamesh: this is the user profile stuff for our project...I want to use properties because eventually we'll combine the stuff in the db and I don't want to change the code that references them |
14:49.33 | jdobrien | jamesh, radix: thanks for the help |
14:50.43 | jamesh | jdobrien: well, unless lazy creation is something you need, I'd go with the simple solution of creating the linked object in the constructor. |
14:51.09 | jdobrien | jamesh: yep...doing it now...no need for laziness when it will eventually happen |
14:51.17 | jamesh | jdobrien: if you want to proxy certain attributes from one to the other, take a look at storm.references.Proxy() |
14:51.25 | jdobrien | oooh |
14:51.34 | jdobrien | that sounds intreaguing |
14:51.48 | jdobrien | intriguing even |
14:52.36 | jdobrien | jamesh: thank you! |
14:53.30 | jdobrien | I'm glad I asked...I figured there had to be a more elegant solution |
14:53.49 | jamesh | niemeyer: if you have a chance to look at the compile_python question I posted to the list, that'd be great. I ran into a few cases where ResultSet.set() failed due to the current limitations. |
14:54.10 | jamesh | jdobrien: Storm even knows how to handle proxy attributes in expressions. |
14:54.18 | jdobrien | wonderful |
14:54.44 | niemeyer | jamesh: I've read it, but haven't had time to really get into it since this week is being a little heavier than usual, but I have it in mind and will get back to you very soon |
14:56.18 | jamesh | niemeyer: thanks. |
14:57.19 | niemeyer | jamesh: You're welcome, and sorry for the delay |
15:12.23 | jdobrien | jamesh: I can't figure why i am getting this error Reference used in an unknown class |
15:16.34 | jamesh | jdobrien: one of the classes involved in the reference isn't a storm class? |
15:16.53 | jdobrien | jamesh: do they need to inherit from Storm? |
15:17.55 | jamesh | jdobrien: shouldn't need to |
15:19.02 | jdobrien | i think i found the problem |
15:19.30 | jdobrien | yep |
15:19.38 | jdobrien | forgot to delete one of my old properties |
15:19.53 | jdobrien | that Proxy is exactly what i was looking for |
15:21.28 | jdobrien | jamesh: do you recall, can a user have multiple records in django_openid_auth_useropenid |
15:22.00 | jamesh | jdobrien: yes, but I don't think we expose a way to cause that to happen |
15:22.49 | jdobrien | jamesh: but it would be a breakage I assume if the reference(...on_remote=True) had multiple records I assume |
15:24.28 | jamesh | jdobrien: we could add a unique index if we wanted to make sure we don't get more than one. |
15:25.39 | jdobrien | jamesh: i would think it might depend on how we handle things with the SSO too |
15:26.13 | jdobrien | jamesh: but this is beyond a #storm conversation :-) |
17:22.27 | *** join/#storm jukart (n=jukart@d91-128-122-124.cust.tele2.at) |
18:17.57 | *** join/#storm jukart_ (n=jukart@d91-128-122-124.cust.tele2.at) |
19:18.22 | *** join/#storm jamesh (n=james@canonical/launchpad/jamesh) |
21:54.40 | thumper | is there ahy w |
21:54.57 | thumper | I mean... |
21:55.17 | thumper | is there any way to specify that a particular field should be re-read automagically from the DB on updates? |
21:55.36 | thumper | I know about storm.locals.AutoReload |
21:55.43 | thumper | but you have to assign that to a field |
21:58.06 | radix | thumper: not sure what you mean |
21:58.23 | radix | maybe you want field = Int(default=AutoReload) # or whatever |
21:58.30 | thumper | radix: I have a field for an object that is updated by a before update or insert |
21:58.43 | radix | oh, a trigger? |
21:58.45 | thumper | radix: when I update "name" say, this field gets updated |
21:58.58 | thumper | radix: db trigger |
21:59.03 | radix | right ok |
21:59.20 | radix | I guess when you change the name attribute you should set that field to AutoReload at the same time |
21:59.32 | thumper | hmm... |
23:53.18 | *** join/#storm shaunm (n=shaunm@c-98-212-133-244.hsd1.il.comcast.net) |