Re: Model_Task function names

Shad Laws <shad-xpYdmXCiSuZWk0Htik3J/[email protected]> Fri, 3 May 2013 22:15:39 +0200
Newsgroups gmane.comp.web.gallery.devel
Message-ID <CA+z51A66owNL1_iAZ97MpN70iZUdpW7uKD5oDhM+nR+aGfpVKw@mail.gmail.com>
--===============7669447551020123677==
Content-Type: multipart/alternative; boundary=089e0158c3e0f03f9b04dbd604fb

--089e0158c3e0f03f9b04dbd604fb
Content-Type: text/plain; charset=UTF-8

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 ]
>>
>
>

--089e0158c3e0f03f9b04dbd604fb
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I like it. =C2=A0Wanna dive in or should I?</div><div clas=
s=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On 3 May 2013 22:11, B=
harat Mediratta <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]"=
 target=3D"_blank">[email protected]</a>&gt;</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. =C2=A0We could=
 use the K3 model and just have:</div><div><br></div><div>=C2=A0 data($key,=
 $value=3Dnull)</div>

<div><br></div><div>So for examples:</div><div><br></div><div>

=C2=A0 $task-&gt;data(&quot;foo&quot;, &quot;bar&quot;); =C2=A0// set the v=
alue of &quot;foo&quot; to &quot;bar&quot;</div><div>=C2=A0 $task-&gt;data(=
&quot;foo&quot;); =C2=A0// return the value of &quot;foo&quot;</div><div><b=
r></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">&lt;<a href=3D"mailto:shad-xpYdmXCiSuZWk0Htik3J/[email protected]" target=3D"_blank">shad@sh=
adlaws.com</a>&gt;</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&#39=
;s content column. =C2=A0This totally clobbers the K3 ORM, which has a get(=
) and set() of its own. =C2=A0Bummer.</div><div><br></div><div>I briefly lo=
oked into overloading the ORM get() and set(), but I don&#39;t think it&#39=
;s a great idea. =C2=A0If someone ever wants to get/set something that has =
the name of a task column (e.g. &quot;id&quot;), it&#39;s hard to tell what=
 to do.</div>





<div><br></div><div>So, it looks like we&#39;ll have to rename them. =C2=A0=
Perhaps something like:</div><div>get_task(), set_task()</div><div>get_cont=
ext(), 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&#39;s a free troubleshooting tool designed for production<br>
Get down to code-level detail for bottlenecks, with &lt;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 --&gt; <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 --&gt; <a href=3D"http://gallery.sf.net" target=
=3D"_blank">http://gallery.sf.net</a> ]<br></blockquote></div><br></div>
</blockquote></div><br></div>

--089e0158c3e0f03f9b04dbd604fb--


--===============7669447551020123677==
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
--===============7669447551020123677==
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 ]
--===============7669447551020123677==--