-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Vlad,

On 27 Jan 2010, at 22:29, haronmedia wrote:

I am also very new to Python so it might take a little
while before I get a grip and do a (rather big) paradigm shift from
PHP to Python.

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.

The problem is I don't want to build a generic CMS. We had one but soon
we realized that trying to make it as generic and flexible as possible
was a waste of time.

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

Putting convention before configuration led to lack
of flexibility. Putting configuration before convention led to
maintenance and deployment nightmares.

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.

So what I have actually is a set of reusable MVC components revolving
around some minimal central framework. [...] I believe something like
this can be rewritten and based on the Pylons framework.

Pylons is a good fit for that approach, it will afford you plenty of freedom to rewrite your components in a controlled fashion.

As for modularity, being fully RESTful components that's not
much of an issue. Each manages a resource behind a set of URIs, and HTTP
verbs are basically translated to component CRUD functionality.

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.

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]

An important part where I can foresee some problems is the security like
form authentication because the components do not rely on "sessions",
and permission system which requires a specific User component and is
database based: dynamic permission profiles.

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'

So in short, these are just controllers, (declarative) models and
templates that are built to manage a specific resource. They don't
publish any API that would require modification of the framework or WSGI
middleware itself, except maybe the User component, but I'll see about
that, I have to dig deeper into current Pylons implementation with
AuthKit, so that I don't reinvent the wheel.

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).

easy_installing shabti will install a bunch of pre-configured project templates that are added to the paster repertoire, visible with "paster create --list-templates", which you can then choose to instantiate with "paster create -t a_shabti_template myproj".

I'll hazard a guess that you should be able to readily adapt either the tesla paste plugin code or the shabti paste plugin code for your purposes. It's not quite the mix-and-match drop-in solution that you envisage but it should get you a ways down the road.

I set up a separate Shabti google group [10] for questions, discussions, etc. - because of the range of the additional packages/ modules referenced in the Shabti templates, the focus is not necessarily specific to Pylons.

BTW, the pylonshq.com site has broken Mailing list signup form, and
contact Admins is not linked. :)


AUIU, they've been left as exercises for the reader, a welcoming bitbucket repos awaits :-)

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 :-)

[1] 
http://pylonshq.com/docs/en/0.9.7/controllers/#using-the-paster-restcontroller-template
[2] http://bitbucket.org/gjhiggins/shabti/src/tip/shabti/templates/scaffolding/
[3] http://bitbucket.org/bbangert/kai/
[4] http://groups.google.com/group/shabti/browse_thread/thread/e9a405b11bf875e2
[5] http://docs.formalchemy.org/current/ext/pylons.html#restfulcontroller
[6] 
http://code.google.com/p/tesla-pylons-elixir/source/browse/trunk/tesla/templates/auth_xp/%2Bpackage%2B/model/permissions.py_tmpl
[7] http://elixir.ematia.de/trac/wiki
[8] http://bitbucket.org/gjhiggins/shabti/
[9] http://bel-epa.com/shabtidocs/index.html
[10] http://groups.google.com/group/shabti

Cheers,

Graham

http://www.linkedin.com/in/ghiggins




-----BEGIN PGP SIGNATURE-----

iEYEARECAAYFAktia+gACgkQOsmLt1Nhivw0pwCgvDXaJsavMOB+OkO0jkx/gJYl
RjAAmgP3KN6Y+TgyPpn71/AaOHpfqHtkiQCVAgUBS2Jr6FnrWVZ7aXD1AQLl7gQA
nOnxMvRCDTcUwi6SZjJQiZ9y2H6snfrMYsGUejp22u9r/7zlERYaD+1bPD4PLMan
Og0uI1AK6o2SxnvvzqQ4abAN6PeB8pD2ERFMWNpbR2gItjiIaGns/5NKLCqsFhTP
i4iKHuEAPTIbDG8HM6XpQWqEopVoin2sEbLUvK7H6Qk=
=UcAp
-----END PGP SIGNATURE-----

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

Reply via email to