Split testing in Pyramid - any experiences?

2013-04-10 Thread Benjamin Sims
Hi, I'm trying to implement split testing for a Pyramid / Chameleon application, and I'd appreciate anyone who has experience of this sharing any tips. We always have a test_group attribute available on our requests. We'd like to arrange things such that we can specify that if the user is in

Re: Perform some action before pserve

2012-10-24 Thread Benjamin Sims
For this purpose, I use virtualenvwrapper. You can then put everything into your postactivate file (in /bin) and it will be run automatically. -- Sent from my phone On 24 Oct 2012, at 19:44, Jonathan Vanasco jonat...@findmeon.com wrote: For staging/production, I tend to write startup

Re: Compiling Python

2012-06-13 Thread Benjamin Sims
I've had to build my own before on servers which had old versions as default (*cough* Red Hat *cough*) and it comes in very handy as long as you combine with virtualenv to avoid confusion. You might find that certain libs are missing and you have to do it (as Mariano mentions) - I think I had to

Re: Issue with Validators

2012-05-29 Thread Benjamin Sims
Hi, Is there a particular reason for you to go with Pylons rather than Pyramid? My understanding is that new development in better done in Pyramid, the future of Pylon-style web application development. Ben On 29 May 2012 05:59, Pinakee Biswas pina...@vvidiacom.com wrote: Hi, I am new to

Inter dependent showing/hiding of fields using Deform/Colander

2012-05-14 Thread Benjamin Sims
Hi, I have a form where large sub-sections are shown or hidden depending on the value of another input (e.g. you check a checkbox and five new fields appear). We currently use Deform/Bootstrap and Colander for our forms, and have had good results so far. However, it seems messy and hard to

Re: MySQL has gone away errors...

2012-05-07 Thread Benjamin Sims
The hack that I used to get around this problem was to catch the exception and try the connection a second time in the first function used in each page (that loading the user in that case). This woke up the MySQL server and did the trick. On 7 May 2012 19:46, Mike Orr sluggos...@gmail.com wrote:

Re: Can Pyramid create DB schema from my models?

2012-04-18 Thread Benjamin Sims
You're probably looking for SQLAlchemy: http://www.sqlalchemy.org/ http://pyramid.readthedocs.org/en/1.3-branch/tutorials/wiki2/index.html and specifically the ORM: http://docs.sqlalchemy.org/en/latest/orm/tutorial.html. On 18 April 2012 17:31, Houmie hou...@gmail.com wrote: Hi, I am

Re: Thank You, Chris!

2012-03-19 Thread Benjamin Sims
As Thomas, says, experiment and find what you like. Personally I find knowing vim has its advantages: - available on pretty much every *nix system ever, very handy if you have to SSH into a server to fix something - allows you to work without using the mouse, moving through files quickly and

Re: deform_bootstrap 0.1 released

2012-03-14 Thread Benjamin Sims
schrieb Daniel Nouri: On Mon, Mar 12, 2012 at 6:18 PM, Benjamin Sims benjamins...@gmail.com wrote: Hi, this looks great - I've recently been looking into bootstrap so this is very timely for me. I note however that it is not possible to use use_ajax with the package. I wonder if you

Re: deform_bootstrap 0.1 released

2012-03-13 Thread Benjamin Sims
PM, Benjamin Sims benjamins...@gmail.com wrote: Hi, this looks great - I've recently been looking into bootstrap so this is very timely for me. I note however that it is not possible to use use_ajax with the package. I wonder if you or the deform team might expand on this - what would

Re: deform_bootstrap 0.1 released

2012-03-12 Thread Benjamin Sims
Hi, this looks great - I've recently been looking into bootstrap so this is very timely for me. I note however that it is not possible to use use_ajax with the package. I wonder if you or the deform team might expand on this - what would it take to use the two together? Thanks, Ben On 5 March

Re: SQLA execution error when running Pyramid tests

2012-03-06 Thread Benjamin Sims
. On Mon, Mar 5, 2012 at 2:31 AM, Benjamin Sims benjamins...@gmail.com wrote: Thanks for the help, Relevant section of the traceback is as follows: File /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/loader.py, line 91, in loadTestsFromName module

Re: SQLA execution error when running Pyramid tests

2012-03-05 Thread Benjamin Sims
...@gmail.com wrote: On Fri, Mar 2, 2012 at 3:16 AM, Benjamin Sims benjamins...@gmail.com wrote: on the grounds that there is no bind for DBSession in helper() above. I understand that there is no bind, but helper is not called explicitly nor required by anything in the tests. Does the traceback say

SQLA execution error when running Pyramid tests

2012-03-02 Thread Benjamin Sims
I have an application which in one of its schema files issues an SQLA query: def helper(): return DBSession.query(User).all() I also have some tests which test some elements around the model interactions and that their functions respond correctly. The setup() for these tests create an

Re: easy_install virtualenv with different python package

2012-02-29 Thread Benjamin Sims
I think that what you are looking for is here: http://packages.python.org/distribute/easy_install.html#multiple-python-versions When using virtualenv itself, you can specify which python you wish to use to create the environment:

Re: need your help to overhaul docs

2012-02-22 Thread Benjamin Sims
Sorry, you mentioned your version of the docs in response to a similar comment that I made and I didn't reply. I did find your explanation very helpful in breaking down the explanations into digestible chunks - I'd very much support that yours should be merged into the main documents. Ben On 22

Re: @view_config, one permission, 1+ views errors

2012-02-20 Thread Benjamin Sims
As I understand it, if you do not supply a route_name then the view callable is a fallback: If route_name is not supplied, the view callable will only have a chance of being invoked if no other route was matched. This is when the request/context pair found via *resource

Re: Documentation overhaul specifics

2012-02-13 Thread Benjamin Sims
Sorry to be late to the party, but I would like to pledge £50 (~$80 USD). In terms of concerns/suggestions, I'd particularly like the documentation relating to authentication and authorisation to be expanded - relying on it recently I felt that references to the Glossary from the tutorial didn't

Re: need opinions for dependencies for some Pyramid related code

2012-02-13 Thread Benjamin Sims
On the other hand, while I love Beautiful Soup and used it for many years, I have found that lxml is considerably faster if you are looking to do heavy duty scraping/extraction, so it may be worth consideration depending on what your particular needs are. On 11 February 2012 21:00, Mike Orr

Re: Model validation

2011-12-13 Thread Benjamin Sims
Michael, I wonder if you might give an idea of how you handle that? Do you manually put forms into templates and validate yourself, or do you still use a validation library but with custom templates. Just wondering as I have tried both before. Ben On 13 December 2011 15:48, Michael Bayer

Re: Model validation

2011-12-12 Thread Benjamin Sims
My understanding is that these features are kept out of the Pyramid core in order, as you say, to maintain flexibility and keep things lightweight. You can pick your own library to slot into your stack for this. I have used Deform (http://docs.pylonsproject.org/projects/deform/en/latest/) for

MySQL has gone away errors - any tips?

2011-11-02 Thread Benjamin Sims
Hi all, I continue to have problems since I switched database to MySQL and I'm not making any progress in resolving the issue. Basically, I every so often get the 'MySQL has gone away' error. It mainly occurs when the site has not been used for a few minutes, although sometimes also appears

Re: Intermittent encoding error after moving to Apache

2011-10-28 Thread Benjamin Sims
. On Thu, Oct 27, 2011 at 2:41 PM, Benjamin Sims benjamins...@gmail.comwrote: The log is posted at the end of my previous mail - I do sometimes get 'MySQL has gone away errors' but they do not seem to be always at the same time as this one, which is: UnicodeDecodeError: 'utf8' codec can't decode

Re: Intermittent encoding error after moving to Apache

2011-10-28 Thread Benjamin Sims
://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Python_Interactive_Debugger ) Ben On 28 October 2011 13:05, cd34 mcd...@gmail.com wrote: On Oct 28, 6:27 am, Benjamin Sims benjamins...@gmail.com wrote: sqlalchemy.pool_recycle = 3600 Your pool_recycle needs to be less than /etc/mysql

Re: Intermittent encoding error after moving to Apache

2011-10-28 Thread Benjamin Sims
time with this! On 28 October 2011 14:03, cd34 mcd...@gmail.com wrote: On Oct 28, 8:32 am, Benjamin Sims benjamins...@gmail.com wrote: - I'm not sending any binary data that I'm aware of; page content is text from the MySQL database. Sometimes this error even occurs on my login page

Re: Intermittent encoding error after moving to Apache

2011-10-28 Thread Benjamin Sims
bug. Ben On 28 Oct 2011, at 15:48, cd34 mcd...@gmail.com wrote: On Oct 28, 10:00 am, Benjamin Sims benjamins...@gmail.com wrote: It does sometimes occur on the login page, but also on other pages. It will fail a few times, then start working for a bit and continue that way. I'm

Intermittent encoding error after moving to Apache

2011-10-27 Thread Benjamin Sims
Hi all, I've recently moved from Paster + Sqlite to Apache + MySQL and, well, it hasn't been smooth. I'm running into various problems which are likely due to the server setup (occasional very slow connections, MySQL has gone away errors) etc. However, I have one that is really bugging me and I

Re: Intermittent encoding error after moving to Apache

2011-10-27 Thread Benjamin Sims
Unternehmenssitz: Weiterstadt Geschäftsführer: Oliver Michel, Sven Walther, Dr. Peter Schill Am 27.10.2011 um 20:23 schrieb Benjamin Sims benjamins...@gmail.com: Hi all, I've recently moved from Paster + Sqlite to Apache + MySQL and, well, it hasn't been smooth. I'm running into various

Re: Apache permissions problems deploying Pyramid

2011-10-06 Thread Benjamin Sims
are: 4 drwxrwxr-x 6 benjamin benjamin 4096 Oct 5 20:22 myapp 4 -rwxr-xr-x 1 benjamin benjamin 119 Oct 5 20:27 pyramid.wsgi My understanding is that since this application is being run as me, then running from my own home folder should work. Am I wrong? Ben On 5 October 2011 14:00, Benjamin

Re: Apache permissions problems deploying Pyramid

2011-10-06 Thread Benjamin Sims
Thanks so much Wyatt - it seems it was permissions related. What I had not realised was that even though I had the user set as my own, Apache still needed permissions to access some of the files to run and I had to make sure the wsgi file was marked as executable correctly. That done, it seems

Apache permissions problems deploying Pyramid

2011-10-05 Thread Benjamin Sims
I've been experimenting with moving my Pyramid apps to Apache following the Chris's helpful tutorial at: https://docs.pylonsproject.org/projects/pyramid/1.0/tutorials/modwsgi/. In order to isolate the problem, I've followed the whole thing exactly as is, substituting only correct user names for

Is there an opposite of 'authenticated' in Pyramid?

2011-09-26 Thread Benjamin Sims
That is, a way to check that a user is not authenticated in order to restrict access to a login form? I understand that I can do redirects in the view or remove elements in the template depending on whether there is a user set, just wondering if there is a way to do it at the route config level.

Re: Correct way to use a custom 404 view

2011-09-14 Thread Benjamin Sims
Thanks Michael, adding a view for the Exception context worked perfectly. So, I did this in __init__.py: from myapp.system import error_view config.add_view(error_view, renderer = 'templates/error_template.pt', context=Exception) Ben On 13 September 2011 23:41, Michael Merickel

Correct way to use a custom 404 view

2011-09-13 Thread Benjamin Sims
Hi, I'm trying to generate a custom 404 view for my application. I've read: https://pylonsproject.org/projects/pyramid/dev/narr/hooks.html#changing-the-notfound-view However, I want to be able to have the 404 use a Chameleon template with macros and so forth in order to fit in with the overall

Re: Correct way to use a custom 404 view

2011-09-13 Thread Benjamin Sims
already gone out to paster). Is there a catch-all way to catch the errors in Pyramid and use a fancy error page? Thanks, Ben On 13 September 2011 15:21, Chris McDonough chr...@plope.com wrote: On Tue, 2011-09-13 at 15:05 +0100, Benjamin Sims wrote: Hi, I'm trying to generate a custom 404

Re: How to call python function from javascript

2011-09-12 Thread Benjamin Sims
If wish to build such a feature, there is nothing specifically Pyramid about doing so, although it can help. What you are looking an is an autocomplete box. The components would be: 1. javascript which makes a call to the server with the values to be completed and then fills in the box once the

Re: Webhelpers html tag examples

2011-08-30 Thread Benjamin Sims
If you are looking for a complete form library, there are a few that fit nicely into Pyramid. I've had success with and would recommend deform: https://docs.pylonsproject.org/projects/deform/dev/ The demo site provides nice examples of its capabilities: http://deformdemo.repoze.org/ and there

Re: Extracting translation strings for templates using include macros

2011-08-29 Thread Benjamin Sims
. Ben On 11 August 2011 15:38, Benjamin Sims benjamins...@gmail.com wrote: Since i18n seems to be the topic of the day, I would really appreciate help with this: I have a master template to contain headers and so forth, with various pages 'inheriting'. So, master has: tal metal:define-slot

Re: Switching to declarative configuration breaks paster

2011-08-29 Thread Benjamin Sims
:27 AM, Benjamin Sims benjamins...@gmail.com wrote: Hi, I am switching my application from imperative to declarative configuration using view_config. However, when I add config.scan() to __init.py__, my application refuses to start. If I do: 'paster serve config.ini ', I get a message

Re: Showing delete button for deform sequences forms

2011-08-23 Thread Benjamin Sims
I'm working on (I think) the same thing at the moment, that is passing in an appstruct containing existing values to the form.render() method to allow editing of existing data. I do get the red x's for deletion on the passed in sequences - if we are indeed using the same method, I wonder if your

Re: how to manage pylons/paster config file in a cluster?

2011-08-23 Thread Benjamin Sims
I haven't used it for Pyramid/paster specifically, but I believe Fabric is designed for this sort of automated deployment: http://docs.fabfile.org/en/1.2.1/index.html On 23 August 2011 13:33, Charles springri...@gmail.com wrote: I have 4 nodes running paster app, once I change the config, I

Re: Conditional attributes using Chameleon

2011-08-22 Thread Benjamin Sims
Thank you, that is exactly what I was looking for. Ben On 21 August 2011 20:08, Malthe Borch mbo...@gmail.com wrote: On 21 August 2011 21:01, Gustavo Fonseca gustavof...@gmail.com wrote: I think it would be something like: li class=defaultClass tal:attributes=class 'selectedClass' if a==b

Re: Showing delete button for deform sequences forms

2011-08-22 Thread Benjamin Sims
Sorry if this is just unclear to me... but why would you have the remove sequence button if there is no sequence element to remove? On 22 August 2011 19:00, Chris Pyper ch...@vmfarms.com wrote: The remove sequence item button (the little red x) appears only after you have clicked the add

Conditional attributes using Chameleon

2011-08-21 Thread Benjamin Sims
I'm trying to do something which I think should be pretty straightforward, but I'm having trouble pinning down the exact syntax and would appreciate any tips: I have a static navigation menu consisting of a basic list. The list should 'know' which page it is on and display that particular list

Extracting translation strings for templates using include macros

2011-08-11 Thread Benjamin Sims
Since i18n seems to be the topic of the day, I would really appreciate help with this: I have a master template to contain headers and so forth, with various pages 'inheriting'. So, master has: tal metal:define-slot=mainMain page content in div/tal and the pages will do: tal

Re: Does Chameleon have a comment syntax?

2011-08-10 Thread Benjamin Sims
This is: Chameleon-1.3.0_rc1 pyramid-1.1a1 Ben On 10 August 2011 09:00, Malthe Borch mbo...@gmail.com wrote: On 9 August 2011 21:30, Benjamin Sims benjamins...@gmail.com wrote: Using this syntax throws a NameError: NameError: nothing That's odd. What version do you have? \malthe

Does Chameleon have a comment syntax?

2011-08-09 Thread Benjamin Sims
I'd like to include comments which will not show up in output, and template languages I have used in the past have done this in various ways. However, I can't seem to find a reference to one in Chameleon - does it exist or should I do this in another way? Thanks, Ben -- You received this

Re: Does Chameleon have a comment syntax?

2011-08-09 Thread Benjamin Sims
XML comments display in the outputted source, which I am trying to avoid - I will go with Malthe's syntax I guess. It would be nice though to be able to use something along the lines of: #this is a comment Thanks for the help, Ben On 9 August 2011 17:46, Christoph Zwerschke c...@online.de

Re: Does Chameleon have a comment syntax?

2011-08-09 Thread Benjamin Sims
...@gmail.com wrote: Traditionally, this is done like this: tal:comment replace=nothing Some comment /tal:comment It's a little crude. There could be an explicit syntax for it I suppose. \malthe On 9 August 2011 17:26, Benjamin Sims benjamins...@gmail.com wrote: I'd like to include

Re: Does Chameleon have a comment syntax?

2011-08-09 Thread Benjamin Sims
Personally, I'd say that that syntax (!--? entirely excluded -- ) would be appropriate. It's close enough to HTML comments for non-developer designers to take on quickly and has minimal extra typing. On 9 August 2011 20:04, Malthe Borch mbo...@gmail.com wrote: On 9 August 2011 20:19, Benjamin

Switching to declarative configuration breaks paster

2011-08-04 Thread Benjamin Sims
Hi, I am switching my application from imperative to declarative configuration using view_config. However, when I add config.scan() to __init.py__, my application refuses to start. If I do: 'paster serve config.ini ', I get a message saying 'no such option --reload'. If I just do 'paster serve

Re: Colander, question about self-referential schema

2011-08-01 Thread Benjamin Sims
Hi Stefano, I'm very much a beginner myself, but perhaps I can try and give you a pointer based on how I understand it and those with more experience can correct me if I get it wrong. I'd say don't think of it as trying to convert your SQLAlchemy data model directly into a Colander schema by

Re: Colander, question about self-referential schema

2011-08-01 Thread Benjamin Sims
-referential schema doesn't work. The answer to my question can be summarized as follow: it is not possible :) Regards, Stefano. Il 01/08/11 12.55, Benjamin Sims ha scritto: Hi Stefano, I'm very much a beginner myself, but perhaps I can try and give you a pointer based on how I

Re: Basic setup of pyramid-formalchemy

2011-07-18 Thread Benjamin Sims
July 2011 09:50, Gael Pasgrimaud g...@gawel.org wrote: Hi, First notice that formalchemy has it's own mailing list: http://groups.google.com/group/formalchemy?pli=1 On Wed, Jul 13, 2011 at 6:02 PM, Benjamin Sims benjamins...@gmail.com wrote: Hi, I am currently creating an application

Basic setup of pyramid-formalchemy

2011-07-13 Thread Benjamin Sims
Hi, I am currently creating an application using Pyramid. In order to save time, I am interested in using pyramid_formalchemy to set up the admin interface for CRUD of the underlying objects. I have read the documentation ( http://docs.formalchemy.org/pyramid_formalchemy/) but it isn't entirely

Re: Help with Authentication and Authorization

2011-07-11 Thread Benjamin Sims
I found that looking at the shootout example application: git clone git://github.com/Pylons/shootout.git was helpful for how you might set up a basic User model with password encryption and login etc. Ben On 11 July 2011 20:09, gostones gosto...@gmail.com wrote: Hi everyone, I am new to

Re: Widget oriented

2011-07-01 Thread Benjamin Sims
I'd be very interested in seeing that. As a Pyramid first-timer, I find the documentation itself to be very solid. What I miss are the cookbook-style blog posts which spring up when projects have been around for a long time (How to do X with Pyramid). So, any such tutorials would be very much

Re: Widget oriented

2011-07-01 Thread Benjamin Sims
2011 00:58, Chris McDonough chr...@plope.com wrote: On Sat, 2011-07-02 at 00:57 +0100, Benjamin Sims wrote: I'd be very interested in seeing that. As a Pyramid first-timer, I find the documentation itself to be very solid. What I miss are the cookbook-style blog posts which spring up when

Logging configuration for applications run without paster

2011-06-17 Thread Benjamin Sims
Hello, Thanks for the tips earlier on how to handle Pyramid logging - this was also something that I was having trouble finding the answer for (only being familiar with the very basic style of Python logging). However, I am still having trouble with logging configuration. I have a command line