Re: Model_Task function names
Bharat Mediratta <[email protected]> Fri, 3 May 2013 13:11:53 -0700
| Newsgroups | gmane.comp.web.gallery.devel |
|---|---|
| Message-ID | <CAESa+_nhoW5v+upT7FX8o1BLn3CNzPOR2BLjAxCJ1hBB8zYoQw@mail.gmail.com> |
--===============6396532929685950133==
Content-Type: multipart/alternative; boundary=001517577320adbab804dbd5f80a
--001517577320adbab804dbd5f80a
Content-Type: text/plain; charset=ISO-8859-1
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 ]
>
--001517577320adbab804dbd5f80a
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div style>Hm. =A0We could use the K3 model and just h=
ave:</div><div style><br></div><div style>=A0 data($key, $value=3Dnull)</di=
v><div style><br></div><div style>So for examples:</div><div style><br></di=
v><div style>
=A0 $task->data("foo", "bar"); =A0// set the value o=
f "foo" to "bar"</div><div style>=A0 $task->data(&qu=
ot;foo"); =A0// return the value of "foo"</div><div style><b=
r></div>
<div style>how does that sound?</div></div><div class=3D"gmail_extra"><br><=
br><div class=3D"gmail_quote">On Fri, May 3, 2013 at 1:05 PM, Shad Laws <sp=
an dir=3D"ltr"><<a href=3D"mailto:shad-xpYdmXCiSuZWk0Htik3J/[email protected]" target=3D"_blank">s=
had-xpYdmXCiSuZWk0Htik3J/[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">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>
--001517577320adbab804dbd5f80a--
--===============6396532929685950133==
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
--===============6396532929685950133==
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 ]
--===============6396532929685950133==--