IRC log for #storm on 20091123

00:09.30anykeyah never mind I need to build the python datetime.date type...
00:27.14*** join/#storm drudi (n=drudi@189.121.88.120)
02:45.14*** join/#storm soopos_ (n=soopos@130.233.228.12)
03:40.42*** join/#storm gabriel (n=gabriel@d24-141-18-191.home.cgocable.net)
03:42.44gabrielare there any docs about the "validation framework" mentioned by jamesh at http://www.advogato.org/person/jamesh/diary/270.html ?
03:43.57gabrielmy searches on both the storm wiki and google didn't turn up anything
05:33.15jameshgabriel: sorry, missed your question earlier.
05:34.07jamesha Storm validator is a function (or other callable object) that takes three arguments: the object, attribute name and value
05:34.20jameshit should return the value that the property should be set to
05:34.35jameshif the validator function raises an exception, then the property is not set
05:45.59jameshoh.  and you can set the validator for a property with the validator keyword argument to the constructor (e.g. Int(validator=foo))
05:54.19*** join/#storm stub (n=stub@ppp-58-8-4-170.revip2.asianet.co.th)
06:11.43gabrieljamesh: thanks for the reply. I probably should have addressed it directly to you
06:12.28gabrieljamesh: is the attribute name passed as a string?
06:14.42jameshgabriel: yeah
06:14.55gabrielok
06:15.55gabrieljamesh: is there any support for validators on references or reference sets? or should that be done as validators on the id properties of the link itself?
06:16.24jameshgabriel: only on the properties.
06:19.29gabrieljamesh: but setting validators on a foreign id property could be used to achieve the same result as having a validator on the reference, right?
06:20.44jameshgabriel: if you've got a reference like foo = Reference(foo_id, Foo.id), then executing "object.foo = bar" will end up doing "object.foo_id = bar.id", which will trigger foo_id's validator
06:21.26gabrielGreat. That is tremendously helpful. Thanks a lot!
06:21.39jameshif "bar" has not been flushed to the database yet (in which case it won't have a database ID yet), the validator won't run until the flush happens though.
06:23.47gabrieljamesh: hmmm...yes, I could see that causing some pretty subtle bugs if not kept in mind
06:25.15jameshalthough if you're using transactions properly, it shouldn't be a big issue.
06:26.38gabrieli assume a flush occurs every time a transaction is committed?
06:31.08gabrieljamesh: are reference-based validators not included by design, or is it just that no one has designed/written support for them yet?
06:33.53jameshgabriel: It is more a case that we didn't have a need for them
06:36.13jameshalso, I'm not sure why you'd want a validator attached to a reference that was not run when the underlying field was changed.
06:40.22gabrieljamesh: Yes, perhaps what I'm envisioning (a validator set through a reference but that also attaches itself to the appropriate property) is a bit too magic and not particularly useful.
06:46.01jameshgabriel: I guess the problem with that is that a particular property might be involved in multiple references.
06:46.22jameshe.g. a Reference(on_remote=True) or ReferenceSet() on the other class
06:47.00jameshif you can specify the validators on references and reference sets, then what happens when you have conflicting validators?
06:47.24jameshby having the validator on the property itself, it is unambiguous what will be run
06:48.21gabrieljamesh: that makes plenty of sense. So I guess the answer to my earlier question would be "by design" ;)
06:49.29jameshwell, the main constraints on the design were simplicity and the ability to handle most of Launchpad's use of the SQLObject validation API
06:50.55jameshif you had something that couldn't be handled by the existing API, then that might have been a reason to extend it
06:51.18jameshbut it sounds like your use cases are fairly similar to the ones we've already run into
06:51.37jameshso hopefully what's already there meets your needs
06:52.18gabrieljamesh: yes, sounds like it should
08:28.44gabrieljamesh: thanks again for your help - I've updated https://storm.canonical.com/Manual with some of what you told me. Hopefully I haven't misrepresented anything you said
08:45.26gabrielthe info i added is in the property constructor parameters section
09:27.38*** join/#storm mikex2 (n=mikael@193.11.22.216)
09:43.03*** join/#storm zmijunkie (n=chatzill@83.135.53.218)
10:13.46*** join/#storm jtv (n=jtv@ppp-124-120-193-8.revip2.asianet.co.th)
10:14.19jtvtherve: looks like your fix for bug 475148 is all ready to land
10:14.22mupBug #475148: Object leak on reference flush <Launchpad Translations:Triaged> <Storm:Confirmed for therve> <https://launchpad.net/bugs/475148>
10:14.27jtvis overjoyed :)
11:04.11*** join/#storm stub (n=stub@58.8.4.170)
12:01.57*** join/#storm fcorrea (n=fcorrea@187.3.137.148)
12:05.52*** join/#storm drudi (n=drudi@189.116.190.244)
12:08.51*** join/#storm hazmat (n=kapil@plone/hazmat)
12:15.48*** part/#storm jtv (n=jtv@ppp-124-120-193-8.revip2.asianet.co.th)
12:17.57*** join/#storm elmom (n=elmom@hoasnet-fe29dd00-137.dhcp.inet.fi)
13:08.18*** join/#storm jukart (i=lovely@81.189.156.94)
13:23.05*** join/#storm andrea-bs (n=andrea@ubuntu/member/beeseek.developer.andrea-bs)
13:36.24*** join/#storm ursula (n=ursula@canonical/launchpad/ursinha)
13:54.17*** join/#storm srichter (n=quassel@75.150.101.45)
14:06.38*** join/#storm sidnei (n=sidnei@plone/dreamcatcher)
15:24.47*** join/#storm artista_frustrad (n=artista_@201-15-253-240.ctame704.dsl.brasiltelecom.net.br)
15:49.48*** part/#storm soopos (n=soopos@130.233.228.12)
16:08.13*** join/#storm mikex2 (n=mikael@193.11.22.216)
17:38.39*** join/#storm seiflotfy1 (n=seif@P5118.pallas.wh.tu-darmstadt.de)
17:48.06*** join/#storm niemeyer (n=niemeyer@189-30-249-216.pltce701.dsl.brasiltelecom.net.br)
18:14.47*** join/#storm keppla (n=keppla@i5E868F6A.versanet.de)
18:59.07*** join/#storm jkakar (n=jkakar@24.84.196.20)
19:26.55*** join/#storm jkakar (n=jkakar@S0106001ee57a879c.vc.shawcable.net)
23:53.42*** join/#storm drudi (n=drudi@189.64.75.185)

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