On Apr 29, 2010, at 4:50 PM, Yarko Tymciurak wrote:

> I think this is about data containment.
> 
> RIght now, there is coupling.
> 
> That this bug took long to find suggests its at the periphery of the
> problem space (if it were smack-in-the-middle, lots of people would
> have already complained).
> 
> But - if the bug (as it looks to me) is because of something gluon or
> SQLTABLE, specifically, should not be involved with (format, data
> passed around between app and client / view --- that's _way_ at the
> other end of where gluon should be),  then (in that terminology) your
> proposal takes an imperfectly (but innappropriately) coupled
> situation, and solves it by completing  / patching --- _increasing_
> the coupling.
> 
> The fundamental problem wtih that: at some point, something else from
> the business-logic (i.e. controllers and models at the application
> level)  will change, and someone will _yet again_  have to patch a
> situation.
> 
> I think the real solution shoudl be to look at what SQLTABLE is doing
> (in this case, sorting is DEFINITEVLY a view operation), and just _get
> out of that functionality all together_.
> 
> While the motivation for making useful, common things easily available
> is good, and I have no problem with that, I think the positioning of
> where it is done needs to be adjusted.   This (in my mind) is calling
> loud and clear for a plugin.   Of course, a plugin could still be too
> coupled to your controller, so there is more structural stuff to think
> about here, but I suggest that a simple code / patch solution is
> probably not the right one here.
> 
> Can anyone suggest how to pull sorting out of SQLTABLE into a plugin,
> and in a way that won't break backward compatability?

Another way of looking at this problem is that there's (inevitably, perhaps) 
too much functionality being packed into the URL. Or alternatively, *sharing* 
the URL. The linkto convention isn't really all that great either. Here's one 
hunk of it:

                elif linkto and field.type == 'id':
                    try:
                        href = linkto(r, 'table', tablename)
                    except TypeError:
                        href = '%s/%s/%s' % (linkto, tablename, r_old)
                    r = A(r, _href=href)

If the linkto URL has vars in it, the string-interpolation version of this is 
going to break, because tablename and whatever r_old is are going to get tacked 
on the end of the vars. The lambda form might be salvageable (and maybe that's 
the solution), but since the controller's 'business logic' needs to share the 
URL with SQLTABLE, somehow that sharing needs to be coordinated. 

Reply via email to