Re: [pylons-discuss] a library for building config stores

2019-04-05 Thread Chris Withers

Hi Andi,

Firstly, thanks for the feedback!

On 05/04/2019 04:39, 'andi' via pylons-discuss wrote:

I tried `configurator[yaml]` to get around the Python-package limitation of 
`tzf.pyramid_yml`. Loading of explicit files works well, but merging 
configuration of multiple files seems not as smooth as with `tzf.pyramid_yml`.

I.e. having a nested structure in `file_1.yaml` and only one override of a key 
in the nested structure of `file_2.yaml` will not merge and resolve properly:
```
# file_1.yaml
   logging:
 version: 1
 disable_existing_loggers: false
 root:
   handlers:
 - console
   level: DEBUG

# file_2.yaml
   logging.root.level: INFO
```


Can you show me your example code? This works for me:

>>> from configurator import Config
>>> file_1 = Config.from_text("""
... logging:
...   version: 1
...   disable_existing_loggers: false
...   root:
... handlers:
...   - console
... level: DEBUG
... """, 'yaml')
>>> file_2 = Config.from_text('{"logging": {"root": {"level": 
"INFO"}}}', 'yaml')

>>> file_1+file_2
configurator.config.Config(
{'logging': {'disable_existing_loggers': False,
 'root': {'handlers': ['console'], 'level': 'INFO'},
 'version': 1}}
)


Also it would be nice to have some Pyramid specific documentation.


What would that look like? I'm not sure it belongs in the configurator 
package, which is not targeting any particular framework, but I guess I 
should be thinking about adding "frameworks" sections?


One thing here would be to have one snippet how to apply config values to the Pyramid `pyramid.config.Configurator`. 


If you're starting with a nested dict of config, what's he current best 
practice, from Pyramid's point of view, for applying those to a 
Configurator?



The other interesting point is, what is possible to apply with `configurator` 
(I believe ` tzf.pyramid_yml` mentioned that some initial Pyramid config values 
are required in the ini file).


I'm sorry, I'm not sure what this means?

Chris

--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/eb31a517-7766-60ed-9069-aed353357206%40withers.org.
For more options, visit https://groups.google.com/d/optout.


[pylons-discuss] a library for building config stores

2019-04-04 Thread Chris Withers

Hey Guys,

I wanted to let Pyramid-y people know about a library I finally got 
documented and released:


https://configurator.readthedocs.io/en/latest/

Partly because you're some of the best software engineers I know, and 
I'd really value your feedback.


Partly because I wonder if Pyramid could make use of configurator (I 
know, the name class is unfortunate...) for building the config object, 
rather than being locked to .ini-ness?


Anyway, any feedback very gratefully received.

cheers,

Chris

--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/d443543f-ef3e-c810-992e-d4bd113a32ea%40withers.org.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] config in config files?

2017-08-07 Thread Chris Withers

On 03/08/2017 22:20, Bert JW Regeer wrote:



I guess it is not entirely clear, but here’s docs for the two
methods:
https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html#using-pastedeploy


**settings is provided by your launcher, pserve will use plaster and
call main() on your application that is registered with setup tools and
provide the settings dictionary to do with as you please.


With Steve's pointer to plaster, this sounds great, but how do I tell
pserve to use plaster?


Sorry, also forgot to ask: I can see how the config.include(...) call
can be triggered from settings, but how would I do the same for the
ldap* methods?



You’d have to write some custom code to automatically make those calls,
but you can use the settings dictionary to pull out the values you need.


Okay, stepping back, if I wanted to replace my production.ini with a 
production.yaml, what do I need to change and where?


cheers,

Chris

--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/f6d70888-ca0e-5c7b-02a1-85c2e59e5b77%40withers.org.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] config in config files?

2017-08-03 Thread Chris Withers



On 03/08/2017 22:04, Chris Withers wrote:

On 03/08/2017 19:12, Bert JW Regeer wrote:

You can grab it from a .ini or wherever when using the latest Pyramid
with plaster support (write your own loader to load it from yaml files
for example).

I guess it is not entirely clear, but here’s docs for the two
methods:
https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html#using-pastedeploy


**settings is provided by your launcher, pserve will use plaster and
call main() on your application that is registered with setup tools and
provide the settings dictionary to do with as you please.


With Steve's pointer to plaster, this sounds great, but how do I tell
pserve to use plaster?


Sorry, also forgot to ask: I can see how the config.include(...) call 
can be triggered from settings, but how would I do the same for the 
ldap* methods?


cheers,

Chris

--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/117c5e87-7148-0d1f-f781-2dcff35a86a6%40withers.org.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] config in config files?

2017-08-03 Thread Chris Withers

Hey Steve,

Hope it's all going well too :-)

On 03/08/2017 20:27, Steve Piercy wrote:

On 8/3/17 at 8:12 PM, ch...@withers.org (Chris Withers) pronounced:


What's plaster?


https://docs.pylonsproject.org/projects/plaster/en/latest/


Cool, more out of curiosity than anything: how came montague had to be 
re-implemented as plaster rather than just being polished up to 1.0?


cheers,

Chris

--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/e339c944-7a62-d6cc-bf86-0a707cb68a15%40withers.org.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] config in config files?

2017-08-03 Thread Chris Withers

On 03/08/2017 19:12, Bert JW Regeer wrote:

You can grab it from a .ini or wherever when using the latest Pyramid
with plaster support (write your own loader to load it from yaml files
for example).

I guess it is not entirely clear, but here’s docs for the two
methods: 
https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html#using-pastedeploy

**settings is provided by your launcher, pserve will use plaster and
call main() on your application that is registered with setup tools and
provide the settings dictionary to do with as you please.


With Steve's pointer to plaster, this sounds great, but how do I tell 
pserve to use plaster?


cheers,

Chris

--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/7f3fcdb8-655c-33bc-c516-b1a38488ea8d%40withers.org.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] config in config files?

2017-08-03 Thread Chris Withers

Hi Bert,

Long time no speak, hope you're well!

On 03/08/2017 19:12, Bert JW Regeer wrote:

You can grab it from a .ini or wherever


"or wherever" preferable ;-)


when using the latest Pyramid
with plaster support (write your own loader to load it from yaml files
for example).


What's plaster?



I guess it is not entirely clear, but here’s docs for the two
methods: 
https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html#using-pastedeploy

**settings is provided by your launcher, pserve will use plaster and
call main() on your application that is registered with setup tools and
provide the settings dictionary to do with as you please.


Hoping plaster is something cool, not a typo...

cheers,

Chris


On Aug 3, 2017, at 12:08, Chris Withers <ch...@withers.org
<mailto:ch...@withers.org>> wrote:

Hi All,

Once more determined to actually build something in pyramid, going to
settle on a REST server to feed a web front end and likely a cli tool too.
Looking for advice on best bits to use, but in the meantime, looking at:

https://docs.pylonsproject.org/projects/pyramid_ldap/en/latest/#usage

...I see a bunch of config in a python file, which is what I hate most
about Django.

I would expect to see AuthTktAuthenticationPolicy's secret and ldap
queries and password all coming from a config file.
What's the pattern for this with Pyramid? Also curious what the best
way is to structure an app beyond a trivial one-file-r like that ;-)
In my head, I'm surprised to see the configurator growing ldap_*
methods (I guess added by the config.include('pyramid_ldap')?)

My ageing memory has something in it about .ini format files, but I
know there was some talk of making the config file format pluggable,
how did that pan out?

Excitedly yours,

Chris


--
You received this message because you are subscribed to the Google
Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/pylons-discuss/fd1d91f4-8e6b-cf46-232d-4b9e05f0ac9f%40withers.org.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google
Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to pylons-discuss+unsubscr...@googlegroups.com
<mailto:pylons-discuss+unsubscr...@googlegroups.com>.
To post to this group, send email to pylons-discuss@googlegroups.com
<mailto:pylons-discuss@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/pylons-discuss/A70D0947-EE8B-4254-869F-5B123509C1F4%400x58.com
<https://groups.google.com/d/msgid/pylons-discuss/A70D0947-EE8B-4254-869F-5B123509C1F4%400x58.com?utm_medium=email_source=footer>.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/f64259b8-323e-4aec-db45-dd448683b6ee%40withers.org.
For more options, visit https://groups.google.com/d/optout.


[pylons-discuss] best rest framework/library for pyramid

2017-08-03 Thread Chris Withers

Hi All,

Perennial question for me: what's the best library to use for building 
REST servers with Pyramid?


Ideally looking for:

- username/password auth
- token-based auth
- introspection from sqlalchemy models

Cornice still the best? Doesn't seem to have obvious versions of any of 
the above...


cheers,

Chris

--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/37cb7c54-c4cb-ad22-357a-328e85b69e63%40withers.org.
For more options, visit https://groups.google.com/d/optout.


[pylons-discuss] config in config files?

2017-08-03 Thread Chris Withers

Hi All,

Once more determined to actually build something in pyramid, going to 
settle on a REST server to feed a web front end and likely a cli tool too.

Looking for advice on best bits to use, but in the meantime, looking at:

https://docs.pylonsproject.org/projects/pyramid_ldap/en/latest/#usage

...I see a bunch of config in a python file, which is what I hate most 
about Django.


I would expect to see AuthTktAuthenticationPolicy's secret and ldap 
queries and password all coming from a config file.
What's the pattern for this with Pyramid? Also curious what the best way 
is to structure an app beyond a trivial one-file-r like that ;-)
In my head, I'm surprised to see the configurator growing ldap_* methods 
(I guess added by the config.include('pyramid_ldap')?)


My ageing memory has something in it about .ini format files, but I know 
there was some talk of making the config file format pluggable, how did 
that pan out?


Excitedly yours,

Chris


--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/fd1d91f4-8e6b-cf46-232d-4b9e05f0ac9f%40withers.org.
For more options, visit https://groups.google.com/d/optout.


[pylons-discuss] how necessary is paste.deploy and/or an ini file?

2015-10-20 Thread Chris Withers

Hi All,

I'm not keen on having a .ini config file (project preference is for 
yaml, go figure...) so I was wondering what the difference is between:


config  =  Configurator() ... app  =  config.make_wsgi_app()


and:

from  pyramid.paster  import  get_app,  setup_logging
ini_path  =  '/Users/chrism/modwsgi/env/myapp/production.ini'
setup_logging(ini_path)
app  =  get_app(ini_path,  'main')


What's different between the app in the first snippet and the app in the 
second snippet?


What would need to be done to get other tools (pserve, pshell, etc?) to 
work with a non-ini config?


cheers,

Chris

--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.


[pylons-discuss] what's replaced colander/deform/etc

2015-06-12 Thread Chris Withers

Hi All,

It looks like work on deform, colander and friends stopped development 
at the back end of 2013.


Are they just stable and complete or has focus moved to another set of 
form libraries?
I'm probably going to end up wanting to do ReactJS-ish things, so where 
am I best to start on the server side?


cheers,

Chris

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.


[pylons-discuss] manage.py equivalent?

2015-06-01 Thread Chris Withers

Hi All,

Trying to get back into Pyramid, got a number of projects I want to use 
it for, so expect plenty of silly questions, please feel free to punt me 
at urls...


First up: does Pyramid have a management command framework like 
Django's manage.py?


I couldn't see anything in a quick scan of the PDF docs, but I'm sure I 
remember there being a pyramid shell. Where should I be looking for 
docs on that?


cheers,

Chris

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] manage.py equivalent?

2015-06-01 Thread Chris Withers

On 01/06/2015 08:11, Thierry Florac wrote:

Hi,
Do you want to create new management commands or do you just want to 
get access to the shell?


Yes, I'm wondering if there's a framework for adding in new commands.

Chris

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] manage.py equivalent?

2015-06-01 Thread Chris Withers

For that type of thing, I'd probably use Mush:

http://pythonhosted.org/mush/examples.html

...unless I'm mistaken, once decorated by click, the callables you 
decorate are no longer unit testable, right?


Chris

On 01/06/2015 13:02, Tom Lazar wrote:

i heartily second that suggestion. click is a joy to work with!


On 01 Jun 2015, at 14:00, Oliver dief...@gmail.com wrote:

If you want a really easy framework for managing script options and so on, I 
recommend http://click.pocoo.org

On 01.06.2015 12:08, Chris Withers wrote:

On 01/06/2015 08:11, Thierry Florac wrote:

Hi,
Do you want to create new management commands or do you just want to get access 
to the shell?

Yes, I'm wondering if there's a framework for adding in new commands.

Chris


--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] manage.py equivalent?

2015-06-01 Thread Chris Withers

 it changes the global interpreter state - *sigh*

On 01/06/2015 19:07, Oliver wrote:

more or less: http://click.pocoo.org/4/api/#testing


On 01.06.2015 18:33, Chris Withers wrote:

For that type of thing, I'd probably use Mush:

http://pythonhosted.org/mush/examples.html

...unless I'm mistaken, once decorated by click, the callables you decorate are 
no longer unit testable, right?

Chris

On 01/06/2015 13:02, Tom Lazar wrote:

i heartily second that suggestion. click is a joy to work with!


On 01 Jun 2015, at 14:00, Oliver dief...@gmail.com wrote:

If you want a really easy framework for managing script options and so on, I 
recommend http://click.pocoo.org

On 01.06.2015 12:08, Chris Withers wrote:

On 01/06/2015 08:11, Thierry Florac wrote:

Hi,
Do you want to create new management commands or do you just want to get access 
to the shell?

Yes, I'm wondering if there's a framework for adding in new commands.

Chris


--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to
pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] Re: manage.py equivalent?

2015-06-01 Thread Chris Withers

On 01/06/2015 18:15, Chris McDonough wrote:

Whoa. Fabric.  How did we get there.

Beats me, beer?
The answer is a plain old setuptools console script.  These get 
installed into the Python bin dir when setup.py install or setup.py 
develop is run.  See Pyramid's scripts/pshell.py, scripts/pcreate.py, 
scripts/pserve.py etc as well as Pyramid's own setup.py.  The p* 
commands contain functions that are invoked by the console scripts 
that point to them.


Yep, I think what I was looking for is the bootstrap stuff combined with 
something like click, mush or the stuff from koti.


cheers,

Chris

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] Re: trypyramid.com and python 2.x

2015-05-10 Thread Chris Withers

On 10/05/2015 14:07, wilk wrote:

On 10-05-2015, Mike Orr wrote:

I don't know what by artisans is supposed to mean. It sounds like a
vacuous phrase, especially in regard to web development. We use better
oil paints? More intricate decorations? Not mass produced?

I don't know what it means for you, but in french artisan sound very
good.  It give a lot of value.
It show the difference with perfectionists with deadlines. Something
like savoir faire, done with know-how (not sure), it means also that
you keep control, that you understand really what you do. The opposite
of just resale. With a friend we say website made by hand.
Slight word of caution: in the UK, at least, artisan has been abused to 
be applied to many things, particularly bread, just to inflate the price 
and is now commonly understood to mean pretentious and overpriced, 
that's certainly not Pyramid to me ;-)


Chris

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.


[pylons-discuss] good crud for pyramid + sqlalchemy?

2015-01-02 Thread Chris Withers

Hi All,

What's the current latest and greatest when it comes to building CRUD 
apps using Pyramid for a SQLAlchemy model?


Something like the Django Admin UI or better would be nice, with some 
sexy JS thrown in for good measure ;-)


cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.


[pylons-discuss] pyramid and asynchronous programming

2014-03-09 Thread Chris Withers

Hi All,

So, one of the projects I'm playing with at the moment is a big ball of 
asynchronous networking (tonnes of protocols, some tcp, some multicast) 
which I want to stick a webapi onto (normal requests + websocket).


What's the best way to build the web side of this? I think I'd like to 
use pyramid for the normal request/response parts of the web api and 
some async framework for the websock part of it along with all the other 
network stuff. Does that sound feasible?


Aside from that, what's people's experience/recommendations when it 
comes to the plethora of async stuff currently available?
twisted, tornado, tulip or even good old fashioned asyncore seem like 
possibilities, I'm wondering which way to go


Any other advice people have in this area?

cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] pyramid and asynchronous programming

2014-03-09 Thread Chris Withers

On 09/03/2014 11:31, Hynek Schlawack wrote:

On 9 Mar 2014, at 12:20, Chris Withers wrote:


Aside from that, what's people's experience/recommendations when it comes to 
the plethora of async stuff currently available?
twisted, tornado, tulip or even good old fashioned asyncore seem like 
possibilities, I'm wondering which way to go


Whatever you do, keep your fingers off asyncore, that’s a complete turd 
unfortunately (hence tulip).


Well, okay, but it's been used as the core of waitress, which is a 
relatively recent innovation, so curious about that choice...


Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.


[pylons-discuss] waitress vs mod_wsgi

2014-03-09 Thread Chris Withers

Hi All,

What are the things you should consider when deciding between waitress 
and mod_wsgi when it comes to serving a pyramid app?


cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.


Re: Do I need Pyramid for my [maybe, possibly big] project?

2013-07-06 Thread Chris Withers

On 06/07/2013 03:07, andi wrote:

regarding the db: if you will choose a relational database for main
storage, which makes sense to me, maybe take a look at snowflake (and
abilities to shard) to avoid dead-end situations when you have a little
bit more data.


Not sure what you mean by snowflake, but as someone who works with 
terabytes-sized databases that have 100GB tables added to them each day, 
I'd suggest that Postgres will be absolutely file.


That, and flat files, never underestimate the power of a tree of flat 
files as a good and scalable data store.


cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Do I need Pyramid for my [maybe, possibly big] project?

2013-07-06 Thread Chris Withers

On 06/07/2013 10:53, Chris Withers wrote:


Not sure what you mean by snowflake, but as someone who works with
terabytes-sized databases that have 100GB tables added to them each day,
I'd suggest that Postgres will be absolutely file.


...or fine. Definitely have not had enough sleep!

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Unpacking and using Pyramids without installing?

2013-03-04 Thread Chris Withers

On 04/03/2013 19:46, Han Chuang wrote:

I'm trying to plan for one of my projects, and I'm considering using
pyramid as a base. But while I was fiddling with it, I realized it
wasn't really cross-platform.


Care to provide some evidence/background for your sweeping generalisations?


Is there any way to use pyramid/pylons without installing it?


What do you mean by installing?


I would
like to unpackage it and use it as an import, allowing me to move my
project as a folder to many different computers with different OSes and
performing normally.


It's more usual to have a requirements.txt or buildout.cfg and install 
separately on each machine you need it.


cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: SQLAlchemy frontend for Pyramid

2013-01-06 Thread Chris Withers

On 03/01/2013 18:47, Andreas Jung wrote:

Is there something similar (but smaller) like phppgadmin or
phpmysqladmin available for Pyramid + SQLAlchemy? Basically I have
two or three tables with a long list of columns and I want to
autogenerated add/edit forms and basic query forms within my pyramid
application without having to reinvent wheels. FormAlchemy perhaps comes
close...is there something similar?


Isn't that called Django? ;-)

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: Good form library for pyramid ? Better doing it by hand ?

2012-12-11 Thread Chris Withers

I'm surprised no-one mentioned deform yet... why is that?

http://docs.pylonsproject.org/projects/deform/en/latest/index.html

Chris

On 06/12/2012 09:27, Nicolas Di Pietro wrote:

Hi All,

I'm pretty new in the Pyramid world and still in the learning process.

My question is about the forms generation and validation libraries, is
there a really good one usable with Pyramid AND with good documentation
? For the few last days, I was trying pretty hard to have something
working with some of those libraries but I'm at the point where nothing
works like I would like.

I've tried Deform but I really have problems with the errors, I mean, I
find pretty hard to define customized error messages, i.e., you want to
generate a login page, this login page must be able to display an error
message above the box if the user/password combination is not valid (or
another error is occuring). It's pretty easy to get rid of the huge box
above the form (There was a problem with your submission, Errors have
been highlighted below)(changing the template used), but I'm not able to
replace this box by a customized error message that can depend of the
error (and keeping also the individual messages for each field (i.e:
Required) or changing easily those individual error messages.

I've also tried the ToscaWidget2 Lib, the problem I had with this one
are: I'm not able to use the i18n, I'm not able to get the tooltips on
the fields and the doc is not very very useful (or complete :'( )

I've also tried another one (don't remember, I think it was WTForms) but
if I remember well, I had problems also with the i18n.

So, as I'm loosing a lot of time (let's say about 3-4 days) trying the
different libraries, reading the docs, reading the sources (i.e., trying
to understand what are the possible parameters for TW2 widgets), and not
having exactly what I want, I ask to the list, do you know about a form
generation and validation lib, with support for i18n, easy error
customization, and ability to use all (or almost all) html attributes
(i.e. the title attribute to have tooltips in recent browsers).

If some of you don't use at all such a library, do you have a good
pointer to resources to validate input in a safe and clean way by hand ?

Thank a lot for your comments and ideas.

Have a nice day,

Nicolas

PS: maybe I missed the features of deform and tw2 (and WTForms), I'm
sorry if I offense the different authors of those libs and even if what
I want/need is not in their libs, I want to say thanks for each bit of
the open-source ecosystem.

--
You received this message because you are subscribed to the Google
Groups pylons-discuss group.
To view this discussion on the web visit
https://groups.google.com/d/msg/pylons-discuss/-/sXm8e2r1R-IJ.
To post to this group, send email to pylons-discuss@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.

__
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
__


--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



getting old style path expression with chameleon

2012-11-27 Thread Chris Withers

Hi All,

How can I get back the old ZPT style of path expression?

eg:

html metal:use-macro=view/macros/page

...would unpack and do the view.macros['page'] for me?

cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: getting old style path expression with chameleon

2012-11-27 Thread Chris Withers

On 27/11/2012 09:34, Malthe Borch wrote:

On 27 November 2012 07:58, Chris Withersch...@simplistix.co.uk  wrote:

How can I get back the old ZPT style of path expression?

eg:

html metal:use-macro=view/macros/page

...would unpack and do the view.macros['page'] for me?


I have adapted this code from the path implementation in `z3c.pt`:

 https://gist.github.com/4153332


Wow, that's heavier weight than I expected ;-)

What are template(target = value, target=target, value=call) objects?

cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: getting old style path expression with chameleon

2012-11-27 Thread Chris Withers

On 27/11/2012 09:56, Malthe Borch wrote:

I'm not particularly happy with the code generation facilities in
Chameleon 2.x – just as I wasn't so happy about the AST-less approach
in 1.x. I tried several approaches, but it's difficult to find the
right balance.

Chameleon 1.x just generated the source-code as strings and had Python
itself parse that into an AST. Chameleon 2.x mostly works with the
AST, but uses convenience functions such as `template` to generate
part of the AST.


Perils of writing a templating system, both mcdonc and myself have been 
there, and I think we're both very grateful that you've jumped on that 
grenade ;-)


I would be nice to have path expressions in the core package, and with 
an easy switch for the default expression type to use...


How easily persuadable are you? :-)

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



view_config to register a url to a view

2012-11-22 Thread Chris Withers

Hi All,

I may be imagining this, but in previous versions, was there a way to do:

@view_config(blah='/some/url.html')
def my_view(request):
   ...

In any case, is there any way I can do that now, without calling 
add_route separately?


I have a bunch of views, which have a one to one mapping with routes, 
and it seems a bit weird to have to write both an add_route and a 
view_config for each one...


Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: view_config to register a url to a view

2012-11-22 Thread Chris Withers



On 22/11/2012 08:18, Robert Forkel wrote:

On Thu, Nov 22, 2012 at 9:15 AM, Chris Withersch...@simplistix.co.uk  wrote:

Hi All,

I may be imagining this, but in previous versions, was there a way to do:

@view_config(blah='/some/url.html')
def my_view(request):
...


AFAIK it was the other way round: you could specify view parameters
with add_route. Anyway, when I have lot's of views with one-to-one
mappings to routes I tend to use the imperative config method and
write a small function which does both config.add_route and
config.add_view in one go.


Hmm, if this really is the case, how about we just add a 'path' or 'uri' 
keyword to view_config/add_view that does this:


- use the uri as the route name
- register the view against that route name

Then view_config would just work.

cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: recommend a wysiwyg editor for a pyramid project?

2012-11-09 Thread Chris Withers

On 08/11/2012 18:32, Jonathan Vanasco wrote:

When it comes to the the type of HTML editing you mentioned, I want to
stress 2 things:
- As much as you can , don't allow consumer HTML
- I really suggest forcing everything into Markdown or similar in the
backend, then generating into HTML as needed.


For public stuff, yes indeed. However, this is an interface for content 
authors, who will mainly be me ;-)


Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: recommend a wysiwyg editor for a pyramid project?

2012-11-08 Thread Chris Withers

On 08/11/2012 08:24, Malthe Borch wrote:

On 7 November 2012 22:18, Chris Withersch...@simplistix.co.uk  wrote:

What's the editor choice to go for nowadays?


http://aloha-editor.org/

If you're interested in inline-editing, http://createjs.org/ is a good pick.


Looks interesting, how does it handle images?

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



recommend a wysiwyg editor for a pyramid project?

2012-11-07 Thread Chris Withers

Hi All,

What's the editor choice to go for nowadays?

I'm ideally looking for one with good support for uploading images, 
resizing them client or server side, and with good clean html generated 
that I can style with my own css.


thanks for any help,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: recommend a wysiwyg editor for a pyramid project?

2012-11-07 Thread Chris Withers

On 07/11/2012 21:36, Marten wrote:

I would be astounded so see something like that.


I'm afraid you have astoundingly the wrong end of the stick ;-)

Admittedly, I perhaps wasn't as clear as I should have been, but I'm 
looking at things like TinyMCE and FCKEditor. (or even, showing my age, 
Kupu)


I want to pick something that will let content authors put together 
pages including styled headers, paragraphs, etc and image. I'd like them 
to be able to upload the image through the editor and have the image 
resized, if possible on the client side, if not, on the server.


Just wondering which paths people had been down with Pyramid and if 
there are any recommendations...


cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: recommend a wysiwyg editor for a pyramid project?

2012-11-07 Thread Chris Withers

On 07/11/2012 23:20, Chris Withers wrote:

On 07/11/2012 21:36, Marten wrote:

I would be astounded so see something like that.


I'm afraid you have astoundingly the wrong end of the stick ;-)

Admittedly, I perhaps wasn't as clear as I should have been, but I'm
looking at things like TinyMCE and FCKEditor. (or even, showing my age,
Kupu)

I want to pick something that will let content authors put together
pages including styled headers, paragraphs, etc and image. I'd like them
to be able to upload the image through the editor and have the image
resized, if possible on the client side, if not, on the server.

Just wondering which paths people had been down with Pyramid and if
there are any recommendations...


...and maybe something that already has proven integration with deform?

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



building pyramid docs and developing pyramid

2012-11-05 Thread Chris Withers

Forwarding to the list for the benefit of others :-)

thanks Chris!

Chris

 Original Message 
Subject: Re: Fwd: python setup.py develop and extras
Date: Mon, 05 Nov 2012 01:38:14 -0500
From: Chris McDonough chr...@plope.com
To: Chris Withers ch...@python.org

On 11/05/2012 01:34 AM, Chris Withers wrote:

Hi Chris,

This is actually for trying to build the docs for pyramid from a clone
of the git repo. How do you do this?


Pyramid actually has a setuptools command alias named docs (and
another named dev that installs testing requirements):

python setup.py dev
python setup.py docs

Then run this inside the docs dir of Pyramid:

make clean html SPHINXBUILD=$yourvenv/bin/sphinx-build

- C

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



configuration and registries

2012-03-30 Thread Chris Withers

Hi All,

So, when setting up a Pyramid app we instantiate a Configurator.
One we're handling requests, we have a registry.

If I have some arbitrary config read from a file at the same time as I'm 
instantiating the Configurator, where should I put it?

(thinks of these as application globals, etc)

Is the configurator instance available when handling requests? If so, 
what's the correct API?


Can the registry be used for simple key value pairs or is it only for 
component registrations?


cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: SQLAHelper 1.0 released, and a proposal

2012-02-10 Thread Chris Withers

On 10/02/2012 14:19, Daniel Holth wrote:

I do not understand why I would want to share a declarative_base()
between packages.


A table defined in one package may have foreign key relationships to a 
table defined in another package.


I often hit this with authentication packages where other packages what 
you reference users.


cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: sorry for the deluge...

2012-01-29 Thread Chris Withers

On 29/01/2012 04:52, Chris McDonough wrote:

~ 20 messages were in the moderation queue; Google stopped sending
pending-moderation emails to moderators apparently.


Anyone reported this to Google? It doesn't look deliberate...

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: pyramid and zope.component registry

2012-01-16 Thread Chris Withers

On 16/01/2012 18:58, Chris McDonough wrote:

PS: we just moved the Components code from zope.component.registry to
zope.interface.registry.  So it's the same code, just with a different
name.  So it's exactly the same thing, except much cooler, because it
has a new name. ;-)


For dinosaurs like myself, is there a migration guide anywhere?

(ie: I'm using to calling getSiteManager().registerUtility(), etc, what 
do I do now? Can I still use zope.component's getSiteManager() or will 
things just not work (tm))


cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: SQLAHelper 1.0 released, and a proposal

2011-12-27 Thread Chris Withers

On 26/12/2011 07:46, Mike Orr wrote:

I haven't said much about SQLAHelper in recent months, so many users
may not be aware that it exists. This has led to other packages that
do approximately the same thing.


Yeah, I kinda feel the same way, and I guess I'm a bit bummed that my 
perception is that people have consistently ignored mortar_rdb, which 
covers exactly the same territory. More galling for me is that it's 
existed since early 2010, but I wasn't allowed to open source it until 
early 2011.


Still, I'd like to know what I did wrong that meant people just ignored 
it. My only guess here is that mortar_rdb felt too heavyweight, given 
the (optional) mention of sqlalchemy-migrate in the usage docs? Or maybe 
I didn't publicise it enough? Seriously, I'd like to know, since I feel 
the same about testfixtures and mailinglogger...


Nonetheless, things SQLAHelper is missing from my perspective:

- the ability to pass parameters to the declarative base
  (see 
http://packages.python.org/mortar_rdb/api.html#mortar_rdb.declarative_base)


- control over the session that is stored. As I read it, you'd need to 
call Session.configure in every request.
  (see 
http://packages.python.org/mortar_rdb/api.html#mortar_rdb.registerSession)


I'm planning quite a big chunk of work on mortar_rdb soon (to replace 
sqlalchemy-migrate with alembic, pep8 the api and do a bit of weeding) 
so I'd like to avoid duplicating sqlahelper if possible, but then it may 
just be that sqlahelper covers the common case and mortar_rdb covers the 
less common but more complicated cases)


cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: SQLAHelper 1.0 released, and a proposal

2011-12-27 Thread Chris Withers

On 27/12/2011 16:05, Michael Bayer wrote:



The purpose of SQLAHelper is to solve the most common problem, which
is sharing a single Base and Session across multiple modules,
including those written by third parties who don't know about your
application.


What's the use case for a Base being shared to a third party module that 
doesn't know about your application?


I've hit the situation where I've needed to share a base across multiple 
python packages, only some of which might be used in a particular project.



A Base might have any number of behaviors on it, like certain columns, naming 
conventions, __mapper_args__(), attribute names, that can't be anticipated by a 
third party library.


Yep, that's why I built the registry of bases the way I did in mortar_rdb:

http://packages.python.org/mortar_rdb/api.html#mortar_rdb.declarative_base


The only reason I can think of, is the well you can't link via ForeignKey or 
relationship() with a separate base.  But this is not really true, for a variety of 
reasons.


I still think it'd be great if the registry tied to the base was 
actually in the metadata object. One metadata object instead of two, but 
I have a feeling we've had this conversation before ;-)



Why not standardize SQLAHelper on a one by default, many if desired model ?   
 Also as an alternative to the getter/setter style, why not just:

helper = SQLAHelper()

# default objects: base, session, engine:

default_base = helper.base
default_session = helper.session
helper.engine = create_engine(...)

# namespaces for each, default points to the default:

helper.bases.default is helper.base
helper.sessions.default is helper.session
helper.engines.default is helper.engine


I'm fairly indifferent to the above, I prefer registries myself


# alternates to the default:

helper.bases.generic_base = Base()


but this doesn't solve my use case of having a base shared across 
multiple packages, only some of which may be installed, and some of 
which may be third party.



I think multiple sessions should be supported.  My current app uses two simultaneously as many classes are represented 
in two different databases at the same time - one is the live database the other is historical. 
   An application that switches between master and slave databases at the session level needs 
to do this also.


Yep: http://packages.python.org/mortar_rdb/api.html#mortar_rdb.getSession

...just register each ression with a different name.

cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: Is there any case where chameleon is more preferred?

2011-12-18 Thread Chris Withers

On 18/12/2011 04:51, Chris McDonough wrote:

On Sat, 2011-12-17 at 23:45 -0500, Michael Bayer wrote:

On Dec 17, 2011, at 9:10 PM, Chris McDonough wrote:


For what it's worth, I've been using ZPT (the syntax that Chameleon
implements) for about 9 years.  It's no worse and no better than
anything else; the very act of templating itself blows hard enough that
fighting over what's better is like fighting over the grade of bleach
one should be drinking.


Heh, been using ZPT syntax for 9 years and the act of template blows.I 
have a blast templating in Mako ! :)


Seriously?  A blast?  If so, my hat is off to you sir.

I hate writing UI with HTML and CSS, period.  I don't think any
templating language is going to help that much.  I mean unless maybe it
can grant me special favors. ;-)


Meld or Twiddler ftw!

/troll

In order of rusty-spoon-kneecap-removing preference:

- ZPT, any sane implementation thereof
- Django/Jinja/etc and friends
- Mako

But, as mcdonc said, it's marginal, they all suck in different and 
special ways. My gripe with Mako is that it's too easy to generate 
invalid html, my gripe with ZPT is that it's *hard* to generate valid 
CSS/JS. Of course, Tiddler is awesome, shame it's unmaintained and 
performance sucks rocks through straws - so yeah, I would choose an 
amusing bleach grade, but there aren't any: 
http://www.google.co.uk/search?q=amusing+bleach+brands


Anyway, back to trying to get mysqldb to compile on yet another 
operating system... *sigh*


Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: how to use several Bases with config.include and a shared DBSession

2011-12-17 Thread Chris Withers

On 16/12/2011 23:48, Michael Bayer wrote:

I was just looking to express (and top post, its just easier) that right
now the sharing the base patterns arent' nailed down, but that it can
be whatever. We can make it work whatever way people think should become
a best practice. Though usually things go better when I come up with the
best practice myself after getting a really clear view of the use cases.


More of a SA comment that anything else, but I wish there was one source 
of metadata, the MetaData object, rather than having some in the 
MetaData object and some in the Base...


cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: how to use several Bases with config.include and a shared DBSession

2011-12-16 Thread Chris Withers
Sorry to top-post, but this is one of the reasons I wrote mortar_rdb, 
writing offline from memory, the url is:


http://packages.python.org/mortar_rdb.

Anyway, have a read of the docs, it solves the 
Base-shared-across-packages problem as well as providing session and 
transaction management.


It has a schema-management aspect too, but I regret that now. Thankfully 
it's optional :-)


cheers,

Chris

On 16/12/2011 08:33, Robert Forkel wrote:

On the other hand, I'm not doing anything in my custom cls passed to
declarative_base which could not be done in a mixin class [1].

[1] 
http://www.sqlalchemy.org/docs/orm/extensions/declarative.html#mixin-and-custom-base-classes

On Fri, Dec 16, 2011 at 9:21 AM, Robert Forkelxrotw...@googlemail.com  wrote:

sqlahelpers tried to do exactly this; but this approach makes it
impossible to provide arguments for the construction of the
declarative base [1]. I moved away from sqlahelpers because I wanted
to supply my own base class.
regards,
robert


[1] 
http://www.sqlalchemy.org/docs/05/reference/ext/declarative.html#sqlalchemy.ext.declarative.declarative_base

On Fri, Dec 16, 2011 at 9:12 AM, Chris McDonoughchr...@plope.com  wrote:

On Fri, 2011-12-16 at 02:02 +0100, Viktor Nagy wrote:

hi,


I'm no SQLAlchemy expert but out of curiosity, why can't there be a
master package that all the apps depend on that declares a Base that
all the other packages depend on and import from?

- C





I'm stuck and sweating with a should be simple, so common problem
related sqlalchemy and portable pyramid app development.


I would like bind together several apps using config.include.
All these apps use their own DBSession and Base declarations. The
DBSession shouldn't cause any troubles as scoped session is used
everywhere, but this is not true about the Base declarations.


If I don't want to import the Base of one of my apps (it's not
feasible in my case anyway), then I have to move  every already
defined table from other models' metadata to this Base.metadata,
otherwise SQLAlchemy can not find related tables as they are contained
within separate metadatas.


Moreover, even when I come up with some really dirty solution and
manage to run the pserve, the populate script needs a different
approach just like writing tests, and it seems to me that in every
situation I should invent new approaches, and I'm running out of
ideas. :)


I guess that overcoming such situations should be a common task, so I
would be glad if you would share your experiences with me.


thanks,
Viktor









--
You received this message because you are subscribed to the Google
Groups pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.





--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: Multiple transactions within request

2011-11-19 Thread Chris Withers

On 15/11/2011 01:57, Vlad K. wrote:


Currently my only choice is abandoning Transaction and writing my own
tween to properly commit or rollback the transaction in uncaught
exceptions -- basically rewrite pyramid_tm not to use Transaction.


A pyramid_sa_tm would likely be something that a lot of people would use 
and be interested in, the usecase being that people want to use SA but 
only SA, and not any other type of transaction (which is where you 
really want the transaction package).


It'd also be pretty thin and should be quite easy to write ;-)

cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: Colander: Is preparer supported in schema binding?

2011-11-12 Thread Chris Withers

On 10/11/2011 17:57, Mariano Mara wrote:


I even ran the tests and it worked ok (and my problem seems to be fixed too).
It would be great if somebody with great colander jutsu can say  why such
behavior was not implemented.


I implemented the feature, but I don't used deferreds.
(I didn't like the idea myself, but that doesn't mean they're bad...)

I also have my finger in the xlrd pie, and personally I wish xlrd would 
just create date objects on parsing the .xls rather than the annoying 
number-you-need-to-bend-over-backwards-to-turn-into-a-date ;-)


Why not just store the book *and* the preparer as attributes of the 
Schema instance, then they can both get access to the state?


cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: Building RIAs with Pyramid

2011-11-08 Thread Chris Withers

On 08/11/2011 17:54, Christoph Zwerschke wrote:

I’d like to learn some best practices for building RIAs with Pyramid.


What's an RIA?

TLAs will be the death of us all...

cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: Hosting suggestions

2011-10-01 Thread Chris Withers

I wonder how an Amazon EC2 instance would compare on cost?

cheers,

Chris

On 28/09/2011 22:59, richzilla wrote:

I am currently looking to replace an existing PHP app, with a new
pyramids one. Unfortunately my current webhost only supports CGI,
which is a less than ideal solution for wsgi applications. My question
is, Is anyone aware of any reasonably priced, managed hosting
solutions for WSGI applications, preferably UK / European based. Ive
looked at going down the VPS route, but my server administration is
basic at best, so i wouldnt feel hugely confident. Any suggestions
would be hugely appreciated,
Cheers



--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: Ahet is looking for a maintainer

2011-09-23 Thread Chris Withers

On 21/09/2011 14:07, Ergo wrote:

One thing i was planning to do would be implementing this recipie:

https://docs.pylonsproject.org/projects/pyramid_cookbook/dev/sqla.html#using-a-non-global-session
and have Akhet use the non-global database session.


I wrote a package basically for managing SQLALchemy sessions in Pyramid 
applications:


http://packages.python.org/mortar_rdb/use.html

Ignore the schema versioning stuff if you want, it's not a necessary 
part of the equation...


any problems, shout my way...

cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: pylonian job offer

2011-08-02 Thread Chris Withers

On 27/07/2011 14:58, Cornelius Kölbel wrote:

Hello list,

please apologize this advertisement for a vacancy, but as it deals with
pylons this mailing list might be at least for some of you a perfect
place to ask.


I'd suggest the Python Job Board for this:

http://www.python.org/community/jobs/howto/

cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



mortar_rdb 1.2.0 released!

2011-06-30 Thread Chris Withers

Hi All,

I'm pleased to announce a new release of mortar_rdb.

This package ties together SQLAlchemy, sqlalchemy-migrate and
the component architecture to make it easy to develop projects
using SQLAlchemy through their complete lifecycle.

Changes in this release were:

- Pass None as the default for echo rather than False on the
  advice of Daniel Holth.

- When using mortar_rdb.registerSession, allow exlicit
  disabling of two-phase commit.

- No longer log passwords during session registration.

- Specify sqlalchemy 0.6 as a requirement, until
  zope.sqlalchemy is ported, mortar_rdb shouldn't be
  used with :mod:`sqlalchemy` 0.7.

If you'd like to see what mortar_rdb can do for you, please have a read 
of the narrative usage docs, which give a quick run through of the 
lifespan of a project developers using mortar_rdb:


http://packages.python.org/mortar_rdb/use.html

Full package details including mailing list, irc and bug tracker details 
can be found here:


http://www.simplistix.co.uk/software/python/mortar_rdb

cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: I can't use [\w]{8}(-[\w]{4}){3}-[\w]{12} in add_route pattern ?

2011-06-28 Thread Chris Withers

On 28/06/2011 18:33, Stéphane Klein wrote:

Hi,

I can't use [\w]{8}(-[\w]{4}){3}-[\w]{12} in add_route pattern ?


I'm pretty sure routes are not regex based, so no...

cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: WebOb POST vars like in PHP?

2011-06-26 Thread Chris Withers

On 26/06/2011 12:04, Vlad K. wrote:


Thanks for your reply, but the problem is there is no
request.POST(var), there is request.POST(var[foo]) and at that point
I don't know all the possible values of foo. I solved with with a
custom extraction function.


I'd strongly recommend you look at colander:

http://docs.pylonsproject.org/projects/colander/dev/

...if you just want extraction of structured data from requests.

If you want full form generation, then move on to using deform.

cheers,

Chris


But I can't trust that the order given in the form is the same given
through POST


Yes, you can.


and especially the same reconstructed via WebOb's multidict
entities (since Python's dicts are not ordered).


WebOb's multidicts are ordered.


Suggestions (I mean, other than using a lib or function that parses
foo[id], bar[id], ...)?


If you have to re-write a server without changing a client form then 
yes, your best bet *is* to write a function that mimics what PHP's 
extraction does.


cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: chameleon makes pyramid unfriendly

2011-06-24 Thread Chris Withers

On 21/06/2011 15:02, Malthe Borch wrote:

On 21 June 2011 16:00, Chris Withersch...@simplistix.co.uk  wrote:

1.x, I don't think Pyramid works with 2.x...


It does.


There was definitely something I disliked or ran into problems with when 
it came to 2.x...



Indeed, and making the traceback *much* shorter would also be good...


Can you try 2.x and paste your traceback somewhere so we can look at
it more concretely? Unless you're using some internal API of 1.x, then
2.x should be plug-and-play compatible (minus possible bugs).


Will do, next time I hit problems doing template dev...

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



chameleon makes pyramid unfriendly

2011-06-21 Thread Chris Withers

Hi All,

I just wanted to check if this is just me.
I'm working with Pyramid 1.0 and loving it, except when it comes to 
writing templates.


I'm finding I hate this, and it's really slowing me down. Sure, we all 
make mistakes, but my feeling is that Chameleon's error messages are 
about as baroque and annoying as they get.


Developing with them feels like a massive step back in developer 
productivity from Zope 2's ZPT implementation.


Do others feel like this and, if so, what're we planning on doing about it?

cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: chameleon makes pyramid unfriendly

2011-06-21 Thread Chris Withers

On 21/06/2011 13:10, Malthe Borch wrote:

Developing with them feels like a massive step back in developer
productivity from Zope 2's ZPT implementation.


Is this on 2.x?


1.x, I don't think Pyramid works with 2.x...


Do others feel like this and, if so, what're we planning on doing about it?


I had this idea of making an output such as:

ta:replace=... some expression ...
 ^^^

Followed by the error message. This would help localizing the error.


Indeed, and making the traceback *much* shorter would also be good...

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



config.add_static_view no longer capable of serving favicon.ico?

2011-06-03 Thread Chris Withers

Hi All,

I had this chunk in a repoze.bfg app:

# static views
config.add_static_view('static','jobs:static')
config.add_static_view('favicon.ico',
   'jobs:static/favicon.ico')

...which worked fine, however, in Pyramid 1.0, while /static/favicon.ico 
is served fine, /favicon.ico is not.


Why is that?

cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: Advance MySQL query for pyrmaid framework

2011-05-25 Thread Chris Withers

On 25/05/2011 07:41, saturngod wrote:

Now, I'm thinking about to change pyramid from PHP. I'm using advance
sql query for searching

Current mysql is using

SELECT * , IF( `Word` = 'sim', 1, IF( `Word` LIKE 'sim%', 2,
IF( `Word` LIKE '%sim', 4, 3 ) ) ) AS `sort` FROM `dblist` WHERE
`Word` LIKE '%sim%' ORDER BY `sort` , `Word`;


My guess is you can probably come up with a better way of doing this ;-)

But...


When I read pyramid, there is no code to run sql. Pyramid is using
SQLAlchemy.


Nope, Pyramid doesn't care what data storage mechanism you use.
However, if you're going to use a relational database, I'd definitely 
recommend SQLAlchemy. I'd also recommend 
http://packages.python.org/mortar_rdb/use.html, but then I'm biased...



I am not familier with ORM. Can ORM run sql ? How to run
above query in pyramid ? My current database is using MySQL.


For me, if I really needed to run that, I'd do:

session = getSession()
result = session.execute(
SELECT * , IF( `Word` = 'sim', 1, IF( `Word` LIKE 'sim%', 2,
IF( `Word` LIKE '%sim', 4, 3 ) ) ) AS `sort` FROM `dblist` WHERE
`Word` LIKE '%sim%' ORDER BY `sort` , `Word`;
)

But, I might also suggest having a read of:

http://www.sqlalchemy.org/docs/core/tutorial.html

cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: Reusing sqlalchemy models across several pyramid apps

2011-05-23 Thread Chris Withers

On 23/05/2011 13:35, Daniel Holth wrote:

It is perfectly alright to have 0, 1, or more than one declarative base
class (you will have 0 if you are using the ORM without the declarative
extension). The only limitation I've found is that you have to use class
attributes, not string table names, to reference foreign keys. e.g.
ForeignKey(User.foobar) instead of ForeignKey('usertable.foobar_id')


Right, but if you use mortar_rdb's declarative_base, then you can still 
use string keys, which rely on the declarative base's class registry...


cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: Not sure where to start to ask this...

2011-05-22 Thread Chris Withers

On 23/05/2011 05:10, nak wrote:

I am looking for a forum to try to get support to start an open source
project using pyramid.  Where is the best place to post such an
inquiry?


Here! :-)

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: Best practices for where to work with SQLAlchemy

2011-05-20 Thread Chris Withers

On 20/05/2011 09:35, Chris McDonough wrote:

On Fri, 2011-05-20 at 00:43 -0700, Gopalakrishnan S wrote:

Does transaction manager commit sqlalchemy session? Really?
I like the idea still..


Yes, at least if you have ZopeTransactionExtension configured in your
session.


...which mortar_rdb does for you:

http://packages.python.org/mortar_rdb/use.html

You don't have to use mortar_rdb's declarative_base or controlled stuff 
to use registerSession and getSession ;-)


/plug

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: Reusing sqlalchemy models across several pyramid apps

2011-05-20 Thread Chris Withers

On 19/05/2011 15:57, 371c wrote:

The idea is to:

* create a separate project (eg. models_app) to be installed into the
python env via python setup install - sort of like a shared library.


Use buildout or a virtual_env if you're not already.


* In p1, p2 and/or p3, import models_app to have access to the
shared models.


Sounds perfect.


I have no idea of what could be the dangers of doing this especially
in respect to sqla sessions, pyramid transactions etc..


If you end up with multiple model packages and you use SQLAlchemy's 
declarative extension, then you can end up with where do I define my 
Base? problems.


I added 
http://packages.python.org/mortar_rdb/api.html#mortar_rdb.declarative_base 
to address exactly that problem, see 
http://packages.python.org/mortar_rdb/use.html fora full example.


cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: Best practices for where to work with SQLAlchemy

2011-05-20 Thread Chris Withers

On 20/05/2011 14:00, Alec Munro wrote:

But other than that bit of trivia, any reasons I should structure my
code differently?


Nope, looks good, just make sure you get repoze.tm2 or pyramid_tm in the 
mix, I'd likely opt for the latter...


Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: Customizing tinyMCE by using Deform

2011-05-20 Thread Chris Withers

On 19/05/2011 05:51, Boyi Shafie wrote:

Hi,
Any body can suggest on how to customize tinyMCE using Deform. I use the
'advanced' editor. How do I create interface with deform widget using
tinyMCE.init to include and add buttons. Or is there any other way around.


I guess you need to create a TinyMCE theme (sorry, I don't know how to 
do that) and then pass the theme name to the widget constructor:


http://docs.pylonsproject.org/projects/deform/dev/api.html#deform.widget.RichTextWidget

cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: Disable SQLAlchemy Transaction

2011-05-13 Thread Chris Withers

Hi Jerry,

On 13/05/2011 01:31, jerry wrote:

Everything is still wrapped in one big transaction --

-  for item in items_query.all():
(Pdb)
2011-05-13 08:23:54,109 INFO sqlalchemy.engine.base.Engine.0x...68cc
BEGIN (implicit)
2011-05-13 08:23:54,122 INFO sqlalchemy.engine.base.Engine.0x...68cc
SELECT ...


I don't think this is anything to do with Pyramid.

Read the docs for sessionmaker, particularly those about autocommit:
http://www.sqlalchemy.org/docs/orm/session.html#sqlalchemy.orm.session.sessionmaker

So, you have a transaction created for you, but you can manage it yourself:

session = DBSession()
session.bind = ...your engine...

for item in items_query.all():
   try:
   ...do stuff...
   except:
   session.abort()
   else:
   session.commit()

Now, personally, I like the ZopeTransactionExtension 'cos it lets me 
spell the above in a nicer way and synchronise transactions across 
things like sending mail, writing files to disk, etc.


I also like http://packages.python.org/mortar_rdb/use.html, where the 
pattern would become:


from mortar_rdb import registerSession,getSession
import transaction

registerSession('sqlite://')

session = getSession()
for item in session.query(...).all():
with transaction:
   ...do stuff...

cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: Pyramid Pattern Request: Schema Migrations

2011-05-06 Thread Chris Withers

On 06/05/2011 15:39, Ken Huang wrote:

So...four months later, is Daniel's stucco_evolution the best option for
db migration for Pyramid at this point?

What are the alternatives?


http://packages.python.org/mortar_rdb/use.html

cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: khufu_sqlalchemy 0.5 released

2011-05-05 Thread Chris Withers

Hey Rocky,

On 05/05/2011 03:02, Rocky Burt wrote:

khufu_sqlalchemy is meant to reduce the plumbing required to configure a
SQLAlchemy based database connection with a Pyramid based web app.


Curious if you knew about:
http://packages.python.org/mortar_rdb/use.html

If you did, what about it didn't you like? :-)

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: khufu_sqlalchemy 0.5 released

2011-05-05 Thread Chris Withers

On 05/05/2011 15:23, Rocky Burt wrote:

khufu_sqlalchemy (Khufu-SQLAHelper) has been around a few months longer
than mortar_rdb, that's the only reason.


Ah, okay, frustratingly, mortar_rdb was developed about 6 months before 
its release, but I only got the green light to open source it much later :-/


Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk

--
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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.



Re: Where is formbuild (http://formbuild.org/) repository ?

2009-08-24 Thread Chris Withers

Mike Orr wrote:
 Cc'ing James Gardner, Formbuild's creator. 

Does James still exist? ;-)

Chris

-- 
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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
-~--~~~~--~~--~--~---



Re: How to use MySQLdb in Pylons without using SQLalchemy?

2009-07-22 Thread Chris Withers

Димка Платон wrote:
 How to use MySQLdb in Pylons without using SQLalchemy?

Why would you want to?

Chris

-- 
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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
-~--~~~~--~~--~--~---



unit testing idioms

2009-06-25 Thread Chris Withers

Hi All,

I'm wondering what the common idiom is for unit testing w.r.t. data and
transactions...

So, coming from my ZODB background, in unit tests we usually:

- set up the objects required
- run the code to be tested (which might change, add or delete objects)
- abort the current transaction so no changes are saved and everything
goes back to how it was prior to the start of the test

What's the equivalent in pylons-land when using sqlalchemy as a back end?

How do I get test data needed for a specific test to exist for only that
test?

How do I abort changes made by a test in a unittest.TestCase sublcasses
tearDown method?

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
 - http://www.simplistix.co.uk

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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
-~--~~~~--~~--~--~---



Re: pywin32-security-impersonation

2009-06-06 Thread Chris Withers

viki wrote:
 I have been trying to use the Impersonate user code that you have in
 the PyWin32.chm document.

You'll probably get a better response to these questions on this list:

http://mail.python.org/mailman/listinfo/python-win32

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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
-~--~~~~--~~--~--~---



transactional isolation?

2009-05-28 Thread Chris Withers

Hi All,

Just about finished reading the Pylons book now and left wondering what 
the Pylons story is on transactional isolation?

I'm guessing that the session maker user with the SQLAlchemy integration 
will give isolation sessions per thread and so things should be fine on 
that front, but a lot of the examples use writing to files on disk and 
there seem to a be a lot of possible thread/process related problems to 
the techniques used. Am I missing something or do these book examples 
need big warning disclaimers?

Also, where/how does Beaker store its session data in such a way that 
multi-thread/process apps aren't a problem?

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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
-~--~~~~--~~--~--~---



Re: Alternative Storage choice?

2009-05-28 Thread Chris Withers

Mike Orr wrote:
 ZODB has a thread synchronization layer, so it should work out of the
 box in a multithreaded program.

certainly does :-)

multi-threaded and multi-process are fine with zodb, it's just the 
indexing that is weak, ie: you have to build your own...

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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
-~--~~~~--~~--~--~---



deploying a buildout-based pylons instance using mod_wsgi?

2009-05-28 Thread Chris Withers

Hi All,

Does anyone have experience deploying to mod_wsgi when usign a 
buildout-based pylons instance?

How do you generate the .wsgi file?
Anything else I should watch out for?

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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
-~--~~~~--~~--~--~---



Re: deploying a buildout-based pylons instance using mod_wsgi?

2009-05-28 Thread Chris Withers

Jan Koprowski wrote:
 
 How do you generate the .wsgi file?
 Anything else I should watch out for?
 
 My production environment is mod_wsgi. There is pretty good samples is
 here:
 
 http://wiki.pylonshq.com/display/pylonscookbook/mod_wsgi+and+workingenv.py
 http://code.google.com/p/modwsgi/wiki/IntegrationWithPylons
 
 But there is important modification if You wan't use loggers in Pylons
 under mod_wsgi described here:
 http://groups.google.com/group/pylons-discuss/browse_thread/thread/9b9add4529b3779c

All useful info, but I'm really keen to hear from anyone who's used 
buildout rather than workingenv, virtualenv or anything else to deploy...

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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
-~--~~~~--~~--~--~---



Re: deploying to production?

2009-05-25 Thread Chris Withers

Chris Miles wrote:
 
 paster serve is a reasonable option.  Like I said, mod_wsgi is  
 preferred for me as it simplifies service control.

Yes, there's a lot to be said for that...

Most systems already know how to start and stop Apache...

Is there a good how-to anywhere on serving with mod_wsgi?

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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
-~--~~~~--~~--~--~---



CSS on wiki.pylons.com?

2009-05-20 Thread Chris Withers

Hi All,

Is it just me or is the CSS on:
http://wiki.pylonshq.com/display/pylonsdocs/Using+SQLAlchemy+with+Pylons
...out of whack?

I'm using Google Chrome and all the code boxes have scroll bars in them, 
making them really hard to read, and the paragraph text runs over into 
the black edge margins (ug, why do people think black edge margins area 
good idea?!) so you have to highlight it to read it.

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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
-~--~~~~--~~--~--~---



http://wiki.pylonshq.com/display/pylonsdocs/Home contains broken link

2009-05-20 Thread Chris Withers

...to http://pylonshq.com/WebHelpers/module-index.html

Where has this moved to?

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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
-~--~~~~--~~--~--~---



deploying to production?

2009-05-20 Thread Chris Withers

Hey All,

As a total newbie to Pylons I thought I'd ask some questions about 
deployment:

- which bits of a Pylons project do you version control? *

- how do you build all the other bits? *

- what do people use to serve their sites? Is whatever
   paster serve blah.ini using suitable for serving to the wide world
   or does it need to be proxied through something like Apache?

- if using paster serve, how do people wire it so that it starts at
   machine startup and stops at machine shutdown?

- is paster serve the recommended option? If not, what is?

cheers,

Chris

* I'd like to be using buildout for things wherever possible, the 
following is what I have so far:

[buildout]
parts = pylons
develop = myproj

[pylons]
recipe = zc.recipe.egg
eggs =
   Pylons
   PasteScript
   myproj


-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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
-~--~~~~--~~--~--~---



using buildout with pylons

2009-05-19 Thread Chris Withers

Hi All,

I found this:

http://wiki.pylonshq.com/display/pylonscommunity/Howto+install+Pylons+with+buildout

...which looks nice and straight forward. However, I've been having some 
problems. If I do *exactly* what's on that page, it works, so I guess I 
must have an issue at my end.

BUT, one thing I have noticed so far is that after running buildout, I 
end up with eggs for Paste, PasteDeploy and PasteScript in 
pylons_buildout/myproject, which is wrong.

They should either be in pylons_buildout/eggs or, thanks to my 
default.cfg, in ~/buildout-eggs.

So, what's installing those eggs there and why? Oh, and how can I make 
it stop?

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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
-~--~~~~--~~--~--~---



Re: using buildout with pylons

2009-05-19 Thread Chris Withers

Wichert Akkerman wrote:
 BUT, one thing I have noticed so far is that after running buildout, I 
 end up with eggs for Paste, PasteDeploy and PasteScript in 
 pylons_buildout/myproject, which is wrong.
 
 Everything in setup_requires and test_requires is installed there, 

Why?

 and
 buildout can't prevent that. 

Again, why?

cheers,

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@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
-~--~~~~--~~--~--~---