Re: Model_Task function names

Bharat Mediratta <[email protected]> Fri, 3 May 2013 13:17:51 -0700
Newsgroups gmane.comp.web.gallery.devel
Message-ID <CAESa+_=u36-CWoOz8kQB8mg4HTAFjPti6fW0f=cA_Uckep+X_A@mail.gmail.com>
--===============7185422570009899631==
Content-Type: multipart/alternative; boundary=047d7bdc055c01b8a004dbd60e93

--047d7bdc055c01b8a004dbd60e93
Content-Type: text/plain; charset=ISO-8859-1

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

--047d7bdc055c01b8a004dbd60e93
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div style>I&#39;ll take it.</div></div><div class=3D"=
gmail_extra"><br><br><div class=3D"gmail_quote">On Fri, May 3, 2013 at 1:15=
 PM, Shad Laws <span dir=3D"ltr">&lt;<a href=3D"mailto:shad-xpYdmXCiSuZWk0Htik3J/[email protected]" t=
arget=3D"_blank">shad-xpYdmXCiSuZWk0Htik3J/[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">I like it. =A0Wanna dive in=
 or should I?</div><div class=3D"HOEnZb"><div class=3D"h5"><div class=3D"gm=
ail_extra">

<br><br><div class=3D"gmail_quote">On 3 May 2013 22:11, Bharat Mediratta <s=
pan 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. =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-&gt;data(&quot;foo&quot;, &quot;bar&quot;); =A0// set the value o=
f &quot;foo&quot; to &quot;bar&quot;</div><div>=A0 $task-&gt;data(&quot;foo=
&quot;); =A0// return the value of &quot;foo&quot;</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">&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. =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&#39;t think it&#39;s a g=
reat idea. =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. =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&#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>
</div></div></blockquote></div><br></div>

--047d7bdc055c01b8a004dbd60e93--


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