Re: Pyramid application templates

2010-11-11 Thread Alexandre Conrad
Hey Mike,

I agree with you that having questions would be nice. And for people
not liking the questions, maybe we could have them answered
automatically by passing options such as --with-sqla --with-zodb
--with-mako --with-urldispatch, ... Just an idea.

We could also have just a bare bone Pyramid app with no template
engine an no sqla/zodb. Such a setup could be for a webservice app
that only returns JSON data, no HTML.


2010/11/10 Mike Orr sluggos...@gmail.com:
 I think we need to think strategically about Pyramid's application
 templates. There are already eight of them, with overlapping
 functionality and inconsistent names. There will probably be more
 templates coming, both bundled with Pyramid and separate. ChrisM has
 said he doesn't like conditional templates (i.e., templates with
 questions), but they've worked well in Pylons and they would allow a
 streamlining of the current and future templates.

 The current application templates are:

    * pyramid_starter: BFG style (traversal, imperative)

    * pyramid_starter_zcml: BFG style (traversal, ZCML)

    * pyramid_zodb: BFG style (traversal, ZCML, ZODB)

    * pyramid_alchemy: BFG style (traversal, SQLAlchemy, ? configuration style)

    * pyramid_routesalchemy: primitive Pylons style (URL dispatch +
 SQLAlchemy only)

    * pylons_minimal: Pylons View handler style minimal (with Mako?)

    * pylons_basic: full Pylons View handler style with Mako, no db

    * pylons_sqla: full Pylons view handler style with Mako, with SQLAlchemy

 I'd like to see one template equivalent to the Pylons 1 template, with
 questions for SQLAlchemy and the template engine. The templates are
 pretty straightforward even with the conditionals. Looking forward,
 we'll also need questions for auth and ZODB. (Yes, some apps may want
 both SQLAlchemy and ZODB.)

 The pylons_minimal template is rarely, if ever, used in Pylons 1. Do
 we need it?

 pyramid_routesalchemy can maybe go away because it will just confuse
 people. Or can it be renamed to something minimal or combined with
 pylons_minimal?

 The pylons_ names are a legacy from Pylons 2. Would it be OK to
 rename these pyramid_  and rename the current pyramid_ ones to
 something else? BFG beginners are generally more advanced than Pylons
 beginners, right? Then it would be easier for them to choose the right
 application template no matter what it's called. Either that or we
 could name them all pyramid_, or name the BFG ones
 pyramid_traversal_.

 I think we need to avoid pylons (without suffix) as a template name,
 both because we're identifiying it with Pylons 1, and because there'd
 be an entry point conflict if both Pyramid and Pylons are installed.
 (Who knows which one you'd get?)

 So this all gets into, what do you call the super Pylons template with
 questions? pyramid would be a nice name. Then delete pylons_basic
 and pylons_sqla because it would supercede them, and pylons_minimal
 because who needs it, and pyramid_routesalchemy for the same reason.
 Then the other pyramid_ ones can stay as they are or be renamed
 pyramid_traversal_. (The latter would group them together so that
 people can remember, If I want a BFG or TurboGears style app, use
 pyramid_traversal_.)

 --
 Mike Orr sluggos...@gmail.com

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





-- 
Alex | twitter.com/alexconrad

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



Re: Pyramid application templates

2010-11-11 Thread Mike Orr
On Wed, Nov 10, 2010 at 11:11 PM, Alexandre Conrad
alexandre.con...@gmail.com wrote:
 Hey Mike,

 I agree with you that having questions would be nice. And for people
 not liking the questions, maybe we could have them answered
 automatically by passing options such as --with-sqla --with-zodb
 --with-mako --with-urldispatch, ... Just an idea.

The question prompts are provided by paster create. Supposedly you
can pass variables at the end of the command line to pre-answer them
but it hasn't worked for me.

How do conditionals hinder application maintenance? Or should we just
say that since it hasn't been a problem for Pylons maintainers, that
level of complexity is OK. But if it gets much more complex it could
be too much. E.g., ZODB should only need a couple of if's, but auth
could require several if's and be too complex for the same template.

BTW, how would you make a template that handles both SQLAlchemy and
ZODB? Pylons puts the model definitions and init_model() in
'.__init__', and the Session and Base in 'meta' so they can be
imported into everything without circular imports. but where would
ZODB go? Or does it not really need a model but just a short
initialization function?

 We could also have just a bare bone Pyramid app with no template
 engine an no sqla/zodb. Such a setup could be for a webservice app
 that only returns JSON data, no HTML.

That sounds like a job for pylons_minimal. You'd still have the
distinction of URL dispatch vs traversal. This seems to be the most
fundamental choice people make when they choose an application style.
(Well, that and ZCML.)

-- 
Mike Orr sluggos...@gmail.com

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



Re: Pyramid application templates

2010-11-11 Thread Wichert Akkerman

On 11/11/10 05:05 , Mike Orr wrote:

I'd like to see one template equivalent to the Pylons 1 template, with
questions for SQLAlchemy and the template engine. The templates are
pretty straightforward even with the conditionals. Looking forward,
we'll also need questions for auth and ZODB. (Yes, some apps may want
both SQLAlchemy and ZODB.)


A while ago I made some alternative templates for BFG in a branch: 
http://svn.repoze.org/repoze.bfg/branches/wichert-re-paster/ . The most 
important changes there are a refactoring of application setup: they add 
websetup.py and expose that via a paster setup-app command and move 
creation if initial data to there. That  very similar to what Pylons 1 
does, and removes the (imho bad) behaviour of trying to create initial 
data on every application startup. Perhaps that is something to consider 
as well?


Wichert.

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



Re: Pyramid application templates

2010-11-11 Thread Michael Haubenwallner
On Nov 11, 9:46 am, Mike Orr sluggos...@gmail.com wrote:
 On Wed, Nov 10, 2010 at 11:11 PM, Alexandre Conrad
  We could also have just a bare bone Pyramid app with no template
  engine an no sqla/zodb. Such a setup could be for a webservice app
  that only returns JSON data, no HTML.

 That sounds like a job for pylons_minimal. You'd still have the
 distinction of URL dispatch vs traversal. This seems to be the most
 fundamental choice people make when they choose an application style.
 (Well, that and ZCML.)


I thought that would take no extra base configuration. You could even
use URL dispatch and traversal together as described in
http://docs.pylonshq.com/pyramid/dev/narr/hybrid.html.

-- Michael

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



Re: Pyramid application templates

2010-11-11 Thread Michael Haubenwallner
On Nov 11, 8:11 am, Alexandre Conrad alexandre.con...@gmail.com
wrote:
 Hey Mike,

 I agree with you that having questions would be nice. And for people
 not liking the questions, maybe we could have them answered
 automatically by passing options such as --with-sqla --with-zodb
 --with-mako --with-urldispatch, ... Just an idea.

 We could also have just a bare bone Pyramid app with no template
 engine an no sqla/zodb. Such a setup could be for a webservice app
 that only returns JSON data, no HTML.


+1 (for exact the usecase)

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



Re: Pyramid application templates

2010-11-11 Thread Mike Orr
On Thu, Nov 11, 2010 at 2:29 AM, Michael Haubenwallner
michael.haubenwall...@gmail.com wrote:
 On Nov 11, 8:11 am, Alexandre Conrad alexandre.con...@gmail.com
 wrote:
 Hey Mike,

 I agree with you that having questions would be nice. And for people
 not liking the questions, maybe we could have them answered
 automatically by passing options such as --with-sqla --with-zodb
 --with-mako --with-urldispatch, ... Just an idea.

 We could also have just a bare bone Pyramid app with no template
 engine an no sqla/zodb. Such a setup could be for a webservice app
 that only returns JSON data, no HTML.


 +1 (for exact the usecase)

'pyramid_webservice'?  Or rename 'pylons_minimal' to
'pyramid_minimal'? (There is also a 'pyramid_starter' for traversal
style.)


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





-- 
Mike Orr sluggos...@gmail.com

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



Re: Pyramid application templates

2010-11-11 Thread Andrew Sawyers
On 11/11/10 8:41 AM, Mike Orr sluggos...@gmail.com wrote:

 On Thu, Nov 11, 2010 at 2:29 AM, Michael Haubenwallner
 michael.haubenwall...@gmail.com wrote:
 On Nov 11, 8:11 am, Alexandre Conrad alexandre.con...@gmail.com
 wrote:
 
 We could also have just a bare bone Pyramid app with no template
 engine an no sqla/zodb. Such a setup could be for a webservice app
 that only returns JSON data, no HTML.
 
 
 +1 (for exact the usecase)
 
 'pyramid_webservice'?  Or rename 'pylons_minimal' to
 'pyramid_minimal'? (There is also a 'pyramid_starter' for traversal
 style.)
 
I think _webservice -- explicit is better IMNSHO.

Andrew

 


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



Re: Pyramid application templates

2010-11-10 Thread Chris McDonough
On Wed, 2010-11-10 at 20:05 -0800, Mike Orr wrote:
 I think we need to think strategically about Pyramid's application
 templates.

Agreed.

  There are already eight of them, with overlapping
 functionality and inconsistent names. There will probably be more
 templates coming, both bundled with Pyramid and separate. ChrisM has
 said he doesn't like conditional templates (i.e., templates with
 questions), but they've worked well in Pylons and they would allow a
 streamlining of the current and future templates.

I'm not a fan of them from a testing and code-maintenance perspective,
although I do see their utility for users (it's easier to make choices
interrogatively than to make them a-priori), and I suspect that some
collapsing of them would make changing them easier.

While we don't have automated tests for any of the paster templates now,
we should.  I'd like to make sure we can automate tests for whatever we
come up with.

 The current application templates are:
 
 * pyramid_starter: BFG style (traversal, imperative)
 
 * pyramid_starter_zcml: BFG style (traversal, ZCML)
 
 * pyramid_zodb: BFG style (traversal, ZCML, ZODB)
 
 * pyramid_alchemy: BFG style (traversal, SQLAlchemy, ? configuration 
 style)
 
 * pyramid_routesalchemy: primitive Pylons style (URL dispatch +
 SQLAlchemy only)
 
 * pylons_minimal: Pylons View handler style minimal (with Mako?)
 
 * pylons_basic: full Pylons View handler style with Mako, no db
 
 * pylons_sqla: full Pylons view handler style with Mako, with SQLAlchemy
 
 I'd like to see one template equivalent to the Pylons 1 template, with
 questions for SQLAlchemy and the template engine. The templates are
 pretty straightforward even with the conditionals.

Makes sense to me.


  Looking forward,
 we'll also need questions for auth and ZODB. (Yes, some apps may want
 both SQLAlchemy and ZODB.) The pylons_minimal template is rarely, if ever, 
 used in Pylons 1. Do
 we need it?

Probably not.

 pyramid_routesalchemy can maybe go away because it will just confuse
 people. Or can it be renamed to something minimal or combined with
 pylons_minimal?
 
 The pylons_ names are a legacy from Pylons 2. Would it be OK to
 rename these pyramid_  and rename the current pyramid_ ones to
 something else? BFG beginners are generally more advanced than Pylons
 beginners, right? Then it would be easier for them to choose the right
 application template no matter what it's called. Either that or we
 could name them all pyramid_, or name the BFG ones
 pyramid_traversal_.
 I think we need to avoid pylons (without suffix) as a template name,
 both because we're identifiying it with Pylons 1, and because there'd
 be an entry point conflict if both Pyramid and Pylons are installed.
 (Who knows which one you'd get?)
 

I'm ok with any renamings as long as the tutorials and the project
chapter in the docs are updated to deal with them.


 So this all gets into, what do you call the super Pylons template with
 questions? pyramid would be a nice name. Then delete pylons_basic
 and pylons_sqla because it would supercede them, and pylons_minimal
 because who needs it, and pyramid_routesalchemy for the same reason.
 Then the other pyramid_ ones can stay as they are or be renamed
 pyramid_traversal_. (The latter would group them together so that
 people can remember, If I want a BFG or TurboGears style app, use
 pyramid_traversal_.)

pyramid would be fine by me.  Do you think you could help make that
template?


- C


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



Re: Pyramid application templates

2010-11-10 Thread Christoph Zwerschke

Am 11.11.2010 05:05 schrieb Mike Orr:

I think we need to think strategically about Pyramid's application
templates. There are already eight of them, with overlapping
functionality and inconsistent names. There will probably be more
templates coming, both bundled with Pyramid and separate. ChrisM has
said he doesn't like conditional templates (i.e., templates with
questions), but they've worked well in Pylons and they would allow a
streamlining of the current and future templates.


That's also what I was thinking when I tried out Pyramid. Having a 
template for every combination of options is really not maintainable and 
extendable. But in paster templates you can use a small templating 
language, so conditional templates are easy to implement: 
http://pythonpaste.org/tempita/modules/tempita.html.


TurboGears has used this, too, in order to add options such as 
authorization or switch SQLobject against SQLAlchemy or Genshi against 
Malo. (For historical reasons TG used Cheetah here, but nowadays Tempita 
is a better choice because it's already included in Paste.)


-- Christoph

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