Hi Graham! ;)

On 01/29/2010 06:02 AM, Graham Higgins wrote:
> I suspect that you're going to enjoy programming in Python. I dunno if
> it helps you frame it better but I find that Python is more Lisp-like
> than one might first credit. IMO, the Pylons code itself is a good
> illustrative example of how to get "webby" things done in the language
> and it strikes a good balance between pragmatism and style.

Indeed. A move from C-style syntax is a welcome one, after almost 15
years of it. And I welcome the ability to extend Python with custom C
code anytime I want. Sure PHP can do the same albeit in an uglier
fashion. Although I don't want to turn this into a PHP vs Python thing,
I must say that I was reluctant to try Python but after toying with it
for a while I am now sure PHP will become just a warm fuzzy memory to me. :)


> That sounds like a valuable "learning experience" nevertheless - and
> at least you had the nous to recognise a looming dead end.

Yeah, after a year and two versions into it. :)


> It is a difficult balance to achieve and that difficulty isn't likely
> to go away any time soon because i) it's related to the solution space
> that you're working in and ii) expectations of developers / users are
> always on the move.

Hence my preference to have MVC "templates" that offer basic
functionality for most common webapp needs and leave the developer to
build upon it.



> You've probably already encountered the Pylons rest controller paste
> plugin/template [1] and the Atom-style controller that's also
> described in that section of the docs.

Yes I have, and the support from it for basic REST functionality is
excellent!


> Some other folks are also exploring along those lines. For example,
> Bartosz Radaczyński has contributed "scaffolding" [2], a more
> developed restcontroller. (I'm in the process of augmenting it with
> the rest-decorator approach as used in Kai [3], the Pylons app that
> runs PylonsHQ.)
>
> Also, Vladimir Dronnikov has recently been exploring a few approaches
> to a restful controller with reflected forms generation [4], building
> on Gaël Pasgrimaud's work on the Formalchemy/Pylons restfulcontroller [5]

Thanks, I'll check those.


> Hmm. There is an existing row-based authorisation pattern for Pylons,
> if that's of interest - you can find it in the tesla-pylons-elixir
> project [6], in the "authxp" template. It's based on an
> ActiveRecord-style approach (afforded by elixir [7], a declarative
> layer on top of SQLAlchemy).
>
> However, the detail of that particular pattern requires the elixir
> "associable" extension which is being withdrawn because the same job
> can be done by the existing (and supported) ManyToMany relation. You
> might still get some mileage out of the principles, tho'

Yes I've seen it. I haven't explored it too much, but from the first
glance it seemed the basic approach facilitates checking whether a user
belongs to particular permission group. My favorite approach, though,
and what I'd like to see implemented -- if it already isn't -- is to
have the code check whether the user has the permission to do something
by checking if the permission profiles to which the user belongs,
support that permission. That way the component would allow dynamic
management of permission profiles (through a restful web interface).

My primary concern here is performance, so the component would have to
track given permissions through sessions or similar, per user (also
using "Guest" permission profile for unauth users), naturally to avoid
db lookups per request. This would have to be done carefully not to
"lock" the devs into a particular convention.



> You might like to browse the several auth'n'auth approaches presented
> in the Shabti templates [8, 9], which Vladimir referenced. Shabti is
> an example of the kind of paster plugin that Mike referred to (as is
> the somewhat less sprawling tesla-pylons-elixir project).

Yes I'll take a look into it (btw, thanks Vladimir!).


> Hope this helps to ratify your decision to choose a flexible and
> highly capable construction set instead of a dainty pink fluffy pony.
> Please pick up your hard hat at the site entrance :-)

Actually I was sold back when I saw named function arguments... :))



Vlad

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to