IRC log for #storm on 20090429

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.56jdobrienWhen 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.33jdobriens/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.51jdobrienniemeyer, radix...is this possible ^^
14:43.07radixjdobrien: I don't understand
14:43.15radixif it's a reference, when you access it, it'll give you an object
14:43.22radixrepresenting the referenced object
14:43.45jdobrienhmm
14:44.16jameshIf 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.31radixoh
14:44.35jdobrienjamesh: hmm
14:44.44jdobrienjamesh: that's kind of the point of hiding it
14:45.03radixor, create the object when the parent object is constructed
14:45.13jdobrienradix: that's a good idea
14:45.19jameshe.g "bar = foo.ensure_bar()" instead of "bar = foo.bar"
14:45.50jameshthat'd be good too if you always want the pair of objects.
14:46.35jdobrienjamesh: we do
14:47.24jdobrienjamesh: currently I am using properties to do what your saying...but it's ugly
14:47.55jdobrienyou're
14:47.58jameshthen 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.20jameshif you want lazy creation, then I'd go for a method.
14:48.46jdobrienjamesh: 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.33jdobrienjamesh, radix: thanks for the help
14:50.43jameshjdobrien: 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.09jdobrienjamesh: yep...doing it now...no need for laziness when it will eventually happen
14:51.17jameshjdobrien: if you want to proxy certain attributes from one to the other, take a look at storm.references.Proxy()
14:51.25jdobrienoooh
14:51.34jdobrienthat sounds intreaguing
14:51.48jdobrienintriguing even
14:52.36jdobrienjamesh: thank you!
14:53.30jdobrienI'm glad I asked...I figured there had to be a more elegant solution
14:53.49jameshniemeyer: 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.10jameshjdobrien: Storm even knows how to handle proxy attributes in expressions.
14:54.18jdobrienwonderful
14:54.44niemeyerjamesh: 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.18jameshniemeyer: thanks.
14:57.19niemeyerjamesh: You're welcome, and sorry for the delay
15:12.23jdobrienjamesh: I can't figure why i am getting this error Reference used in an unknown class
15:16.34jameshjdobrien: one of the classes involved in the reference isn't a storm class?
15:16.53jdobrienjamesh: do they need to inherit from Storm?
15:17.55jameshjdobrien: shouldn't need to
15:19.02jdobrieni think i found the problem
15:19.30jdobrienyep
15:19.38jdobrienforgot to delete one of my old properties
15:19.53jdobrienthat Proxy is exactly what i was looking for
15:21.28jdobrienjamesh: do you recall, can a user have multiple records in  django_openid_auth_useropenid
15:22.00jameshjdobrien: yes, but I don't think we expose a way to cause that to happen
15:22.49jdobrienjamesh: but it would be a breakage I assume if the reference(...on_remote=True) had multiple records I assume
15:24.28jameshjdobrien: we could add a unique index if we wanted to make sure we don't get more than one.
15:25.39jdobrienjamesh: i would think it might depend on how we handle things with the SSO too
15:26.13jdobrienjamesh: 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.40thumperis there ahy w
21:54.57thumperI mean...
21:55.17thumperis there any way to specify that a particular field should be re-read automagically from the DB on updates?
21:55.36thumperI know about storm.locals.AutoReload
21:55.43thumperbut you have to assign that to a field
21:58.06radixthumper: not sure what you mean
21:58.23radixmaybe you want field = Int(default=AutoReload) # or whatever
21:58.30thumperradix: I have a field for an object that is updated by a before update or insert
21:58.43radixoh, a trigger?
21:58.45thumperradix: when I update "name" say, this field gets updated
21:58.58thumperradix: db trigger
21:59.03radixright ok
21:59.20radixI guess when you change the name attribute you should set that field to AutoReload at the same time
21:59.32thumperhmm...
23:53.18*** join/#storm shaunm (n=shaunm@c-98-212-133-244.hsd1.il.comcast.net)

Generated by irclog2html.pl Modified by Tim Riker to work with infobot.