Re: Model_Task function names
Bharat Mediratta <[email protected]> Fri, 3 May 2013 13:37:07 -0700
| Newsgroups | gmane.comp.web.gallery.devel |
|---|---|
| Message-ID | <CAESa+_nUGUi44aqUhpZj1qJRG2y6+6yLCJbEpycrMMuVGj-ZTA@mail.gmail.com> |
--===============6009804427812693717== Content-Type: multipart/alternative; boundary=001517577320ed425c04dbd652b8 --001517577320ed425c04dbd652b8 Content-Type: text/plain; charset=ISO-8859-1 Well, can't use my API because get() takes a default value and returns it if the key doesn't exist. And we use that widely. So I went with your get_data() / set_data() API instead. Pushed! On Fri, May 3, 2013 at 1:17 PM, Bharat Mediratta <[email protected]> wrote: > > I'll take it. > > > On Fri, May 3, 2013 at 1:15 PM, Shad Laws <shad-xpYdmXCiSuZWk0Htik3J/[email protected]> wrote: > >> I like it. Wanna dive in or should I? >> >> >> On 3 May 2013 22:11, Bharat Mediratta <[email protected]> wrote: >> >>> >>> Hm. We could use the K3 model and just have: >>> >>> data($key, $value=null) >>> >>> So for examples: >>> >>> $task->data("foo", "bar"); // set the value of "foo" to "bar" >>> $task->data("foo"); // return the value of "foo" >>> >>> how does that sound? >>> >>> >>> On Fri, May 3, 2013 at 1:05 PM, Shad Laws <shad-xpYdmXCiSuZWk0Htik3J/[email protected]> wrote: >>> >>>> Hey everyone, >>>> >>>> While working on the photo/movie/album add/edit forms, I wanted to get >>>> server_add working so I can add and test things, and found a problem: >>>> >>>> We used get() and set() in the task model to get/set things in the >>>> task's content column. This totally clobbers the K3 ORM, which has a get() >>>> and set() of its own. Bummer. >>>> >>>> I briefly looked into overloading the ORM get() and set(), but I don't >>>> think it's a great idea. If someone ever wants to get/set something that >>>> has the name of a task column (e.g. "id"), it's hard to tell what to do. >>>> >>>> So, it looks like we'll have to rename them. Perhaps something like: >>>> get_task(), set_task() >>>> get_context(), set_context() >>>> read(), write() >>>> get_data(), set_data() >>>> ...? >>>> >>>> Thoughts? >>>> >>>> Take care, >>>> Shad >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Get 100% visibility into Java/.NET code with AppDynamics Lite >>>> It's a free troubleshooting tool designed for production >>>> Get down to code-level detail for bottlenecks, with <2% overhead. >>>> Download for free and get started troubleshooting in minutes. >>>> http://p.sf.net/sfu/appdyn_d2d_ap2 >>>> __[ g a l l e r y - d e v e l ]_________________________ >>>> >>>> [ list info/archive --> http://gallery.sf.net/lists.php ] >>>> [ gallery info/FAQ/download --> http://gallery.sf.net ] >>>> >>> >>> >> > --001517577320ed425c04dbd652b8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><br><div style>Well, can't use my API because get() ta= kes a default value and returns it if the key doesn't exist. =A0And we = use that widely. =A0So I went with your get_data() / set_data() API instead= . =A0Pushed!</div> </div><div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Fri,= May 3, 2013 at 1:17 PM, Bharat Mediratta <span dir=3D"ltr"><<a href=3D"= mailto:[email protected]" target=3D"_blank">[email protected]</a>></sp= an> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><div>I'll take it.<= /div></div><div class=3D"HOEnZb"><div class=3D"h5"><div class=3D"gmail_extr= a"><br> <br> <div class=3D"gmail_quote">On Fri, May 3, 2013 at 1:15 PM, Shad Laws <span = dir=3D"ltr"><<a href=3D"mailto:shad-xpYdmXCiSuZWk0Htik3J/[email protected]" target=3D"_blank">shad= @shadlaws.com</a>></span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"><div dir=3D"ltr">I like it. =A0Wanna dive in= or should I?</div><div><div><div class=3D"gmail_extra"> <br><br><div class=3D"gmail_quote">On 3 May 2013 22:11, Bharat Mediratta <s= pan dir=3D"ltr"><<a href=3D"mailto:[email protected]" target=3D"_blank"= >[email protected]</a>></span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><div>Hm. =A0We could us= e the K3 model and just have:</div><div><br></div><div>=A0 data($key, $valu= e=3Dnull)</div> <div><br></div><div>So for examples:</div><div><br></div><div> =A0 $task->data("foo", "bar"); =A0// set the value o= f "foo" to "bar"</div><div>=A0 $task->data("foo= "); =A0// return the value of "foo"</div><div><br></div> <div>how does that sound?</div></div><div class=3D"gmail_extra"><br><br><di= v class=3D"gmail_quote">On Fri, May 3, 2013 at 1:05 PM, Shad Laws <span dir= =3D"ltr"><<a href=3D"mailto:shad-xpYdmXCiSuZWk0Htik3J/[email protected]" target=3D"_blank">shad@sh= adlaws.com</a>></span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"><div dir=3D"ltr">Hey everyone,<div><br></div= ><div>While working on the photo/movie/album add/edit forms, I wanted to ge= t server_add working so I can add and test things, and found a problem:</di= v> <div><br></div><div> We used get() and set() in the task model to get/set things in the task'= ;s content column. =A0This totally clobbers the K3 ORM, which has a get() a= nd set() of its own. =A0Bummer.</div><div><br></div><div>I briefly looked i= nto overloading the ORM get() and set(), but I don't think it's a g= reat idea. =A0If someone ever wants to get/set something that has the name = of a task column (e.g. "id"), it's hard to tell what to do.</= div> <div><br></div><div>So, it looks like we'll have to rename them. =A0Per= haps something like:</div><div>get_task(), set_task()</div><div>get_context= (), set_context()</div><div>read(), write()</div> <div>get_data(), set_data()</div><div>...?</div><div><br></div><div>Thought= s?</div><div><br></div><div>Take care,</div><div>Shad</div></div> <br>-----------------------------------------------------------------------= -------<br> Get 100% visibility into Java/.NET code with AppDynamics Lite<br> It's a free troubleshooting tool designed for production<br> Get down to code-level detail for bottlenecks, with <2% overhead.<br> Download for free and get started troubleshooting in minutes.<br> <a href=3D"http://p.sf.net/sfu/appdyn_d2d_ap2" target=3D"_blank">http://p.s= f.net/sfu/appdyn_d2d_ap2</a><br>__[ g a l l e r y - d e v e l ]____________= _____________<br> <br> [ list info/archive --> <a href=3D"http://gallery.sf.net/lists.php" targ= et=3D"_blank">http://gallery.sf.net/lists.php</a> ]<br> [ gallery info/FAQ/download --> <a href=3D"http://gallery.sf.net" target= =3D"_blank">http://gallery.sf.net</a> ]<br></blockquote></div><br></div> </blockquote></div><br></div> </div></div></blockquote></div><br></div> </div></div></blockquote></div><br></div> --001517577320ed425c04dbd652b8-- --===============6009804427812693717== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite It's a free troubleshooting tool designed for production Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap2 --===============6009804427812693717== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline __[ g a l l e r y - d e v e l ]_________________________ [ list info/archive --> http://gallery.sf.net/lists.php ] [ gallery info/FAQ/download --> http://gallery.sf.net ] --===============6009804427812693717==--